Add test_valid_api_version in the test_constraints

There is a valid_api_version function in the constraints,but it has no
tests in the test_constraints. Therefore, I add test_valid_api_version.

Change-Id: Ic8dbe9c00f762513ec9a4ffc0b77e4e5d3e5d47b
This commit is contained in:
zheng yin 2016-09-06 11:55:41 +08:00
parent 18fa28c6c9
commit ba912a10b0

View File

@ -464,6 +464,16 @@ class TestConstraints(unittest.TestCase):
self.fail('check_container_format did not raise error for %r' % self.fail('check_container_format did not raise error for %r' %
req.headers['X-Versions-Location']) req.headers['X-Versions-Location'])
def test_valid_api_version(self):
version = 'v1'
self.assertTrue(constraints.valid_api_version(version))
version = 'v1.0'
self.assertTrue(constraints.valid_api_version(version))
version = 'v2'
self.assertFalse(constraints.valid_api_version(version))
class TestConstraintsConfig(unittest.TestCase): class TestConstraintsConfig(unittest.TestCase):