Code Review
/
releng.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix security issues of eval-s in testapi
[releng.git]
/
utils
/
test
/
result_collection_api
/
opnfv_testapi
/
tests
/
unit
/
test_fake_pymongo.py
diff --git
a/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py
b/utils/test/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py
index
9a1253e
..
5f50ba8
100644
(file)
--- a/
utils/test/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py
+++ b/
utils/test/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py
@@
-115,7
+115,8
@@
class MyTest(AsyncHTTPTestCase):
self.assertEqual(name_error, error)
def _eval_pods_db(self, method, *args, **kwargs):
self.assertEqual(name_error, error)
def _eval_pods_db(self, method, *args, **kwargs):
- return eval('self.db.pods.%s(*args, **kwargs)' % method)
+ table_obj = vars(self.db)['pods']
+ return table_obj.__getattribute__(method)(*args, **kwargs)
if __name__ == '__main__':
if __name__ == '__main__':