summaryrefslogtreecommitdiffstats
path: root/tests/unit/common
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-07-13 06:14:43 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-07-13 07:12:47 +0000
commitcc3c7796ccb30b021c219cabdbe73bfc14fb38cc (patch)
tree95e3b5468ee76e4d8e023fad7a43775fa6213ef2 /tests/unit/common
parent49be6a8c0f42c9a12af305721beac95285f74b2b (diff)
Add API to get environments
JIRA: YARDSTICK-716 API: /api/v2/yardstick/environments METHOD: GET Change-Id: I46b7fb2b143fe76b6a0edbf1ecc8281187b85918 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'tests/unit/common')
-rw-r--r--tests/unit/common/test_utils.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/unit/common/test_utils.py b/tests/unit/common/test_utils.py
index 7f260cfe6..664b38b13 100644
--- a/tests/unit/common/test_utils.py
+++ b/tests/unit/common/test_utils.py
@@ -163,6 +163,19 @@ class TranslateToStrTestCase(unittest.TestCase):
self.assertEqual(result, output_str)
+class ChangeObjToDictTestCase(unittest.TestCase):
+
+ def test_change_obj_to_dict(self):
+ class A(object):
+ def __init__(self):
+ self.name = 'yardstick'
+
+ obj = A()
+ obj_r = utils.change_obj_to_dict(obj)
+ obj_s = {'name': 'yardstick'}
+ self.assertEqual(obj_r, obj_s)
+
+
def main():
unittest.main()