Fix security issues of eval-s in testapi
[releng.git] / utils / test / result_collection_api / opnfv_testapi / tests / unit / test_dashboard.py
index 8f729c0..27ec763 100644 (file)
@@ -8,9 +8,10 @@
 ##############################################################################
 import unittest
 
-from test_result import TestResultBase
 from opnfv_testapi.common.constants import HTTP_NOT_FOUND, HTTP_OK
 
+from test_result import TestResultBase
+
 
 class TestDashboardBase(TestResultBase):
     def setUp(self):
@@ -63,7 +64,7 @@ class TestDashboardQuery(TestDashboardBase):
             if k == 'self' or k == 'uri':
                 continue
             if v is None:
-                v = eval('self.' + k)
+                v = self.__getattribute__(k)
             if v != 'missing':
                 uri += '{}={}&'.format(k, v)
         uri += 'pod={}&'.format(self.pod)