Merge "Fix missing python packages for password generation"
[releng.git] / utils / test / testapi / 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 httplib
10 import unittest
11
12 from opnfv_testapi.resources import models
13 from opnfv_testapi.tests.unit import executor
14 from opnfv_testapi.tests.unit import test_base as base
15
16
17 class TestVersionBase(base.TestBase):
18     def setUp(self):
19         super(TestVersionBase, self).setUp()
20         self.list_res = models.Versions
21         self.basePath = '/versions'
22
23
24 class TestVersion(TestVersionBase):
25     @executor.get(httplib.OK, '_get_success')
26     def test_success(self):
27         return None
28
29     def _get_success(self, body):
30         self.assertEqual(len(body.versions), 1)
31         self.assertEqual(body.versions[0].version, 'v1.0')
32         self.assertEqual(body.versions[0].description, 'basics')
33
34
35 if __name__ == '__main__':
36     unittest.main()