summaryrefslogtreecommitdiffstats
path: root/utils/test/result_collection_api/tests/unit
diff options
context:
space:
mode:
authorMorgan Richomme <morgan.richomme@orange.com>2016-05-31 08:59:42 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-05-31 08:59:42 +0000
commit1e2c8d51ccc9720758f01e418957fdd826c278df (patch)
tree6d4980a983b4d01f9f925b7f8407a18541c1dc2c /utils/test/result_collection_api/tests/unit
parent16dff1bf982d842bcdd717ff8c69627f1cdbdb52 (diff)
parentc013525b837ab047cd6a3583b31b4a8253cb7932 (diff)
Merge "bugfix: version return body is inconsistent with the designed model"
Diffstat (limited to 'utils/test/result_collection_api/tests/unit')
-rw-r--r--utils/test/result_collection_api/tests/unit/test_version.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/utils/test/result_collection_api/tests/unit/test_version.py b/utils/test/result_collection_api/tests/unit/test_version.py
index a58cd5629..8e544e060 100644
--- a/utils/test/result_collection_api/tests/unit/test_version.py
+++ b/utils/test/result_collection_api/tests/unit/test_version.py
@@ -1,15 +1,14 @@
-import json
import unittest
from test_base import TestBase
-
+from resources.models import Versions
__author__ = 'serena'
class TestVersionbBase(TestBase):
def setUp(self):
super(TestVersionbBase, self).setUp()
- self.list_res = None
+ self.list_res = Versions
self.basePath = '/versions'
@@ -17,9 +16,9 @@ class TestVersion(TestVersionbBase):
def test_success(self):
code, body = self.get()
self.assertEqual(200, code)
- json_body = json.loads(body)
- self.assertEqual(len(json_body), 1)
- self.assertEqual('basics', json_body[0].get('v1'))
+ self.assertEqual(len(body.versions), 1)
+ self.assertEqual(body.versions[0].version, 'v1.0')
+ self.assertEqual(body.versions[0].description, 'basics')
if __name__ == '__main__':
unittest.main()