diff options
author | Morgan Richomme <morgan.richomme@orange.com> | 2016-09-14 07:18:45 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-09-14 07:18:46 +0000 |
commit | fdfd228828e539d3068c6b413414e5dc587814e1 (patch) | |
tree | b69c3e54051811cfb0463609de3cd5d4d1ab6406 /result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py | |
parent | f8c3682b609b5fa238385d69e34e397ec6ec1bfd (diff) | |
parent | 6e52f48dbad2d39ebe124e6926e78fd0bca29adb (diff) |
Merge "Fix security issues of eval-s in testapi"
Diffstat (limited to 'result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py')
-rw-r--r-- | result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py b/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py index 9a1253e..5f50ba8 100644 --- a/result_collection_api/opnfv_testapi/tests/unit/test_fake_pymongo.py +++ b/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): - 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__': |