Merge "add copyright to files in testAPI"
[releng.git] / utils / test / result_collection_api / opnfv_testapi / tests / unit / test_version.py
1 ##############################################################################
2 # Copyright (c) 2016 ZTE Corporation
3 # feng.xiaowei@zte.com.cn
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 import unittest
10
11 from test_base import TestBase
12 from opnfv_testapi.resources.models import Versions
13
14
15 class TestVersionBase(TestBase):
16     def setUp(self):
17         super(TestVersionBase, self).setUp()
18         self.list_res = Versions
19         self.basePath = '/versions'
20
21
22 class TestVersion(TestVersionBase):
23     def test_success(self):
24         code, body = self.get()
25         self.assertEqual(200, code)
26         self.assertEqual(len(body.versions), 1)
27         self.assertEqual(body.versions[0].version, 'v1.0')
28         self.assertEqual(body.versions[0].description, 'basics')
29
30 if __name__ == '__main__':
31     unittest.main()