summaryrefslogtreecommitdiffstats
path: root/tests/unit/common/test_utils.py
diff options
context:
space:
mode:
authorRex Lee <limingjiang@huawei.com>2017-07-14 03:56:16 +0000
committerGerrit Code Review <gerrit@opnfv.org>2017-07-14 03:56:16 +0000
commit6acd5d156ba25d1eed49763fb220a117a43d5ef8 (patch)
tree605b149c78ff2997f50cc054f301ea3edc5b804f /tests/unit/common/test_utils.py
parentebf9803aa3f8c9851e845f80145329f59863267c (diff)
parentcc3c7796ccb30b021c219cabdbe73bfc14fb38cc (diff)
Merge "Add API to get environments"
Diffstat (limited to 'tests/unit/common/test_utils.py')
-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()