def test_remove_version_from_href(self, fixture, expected): """Test for removing version from href This test conatins following test-cases: 1) remove major version from href 2-5) remove version from href 6) remove version from href version not trailing domain """ actual = common.remove_version_from_href(fixture) self.assertEqual(expected, actual)
def test_remove_version_from_href_version_not_trailing_domain(self): fixture = 'http://cinder.example.com/cinder/v2' expected = 'http://cinder.example.com/cinder' self.assertEqual(expected, common.remove_version_from_href(fixture))
def test_remove_version_from_href_4(self): fixture = 'http://cinder.example.com/v1.1/images/v10.5' expected = 'http://cinder.example.com/images/v10.5' actual = common.remove_version_from_href(fixture) self.assertEqual(expected, actual)
def test_remove_version_from_href_4(self): fixture = 'http://www.testsite.com/v1.1/images/v10.5' expected = 'http://www.testsite.com/images/v10.5' actual = common.remove_version_from_href(fixture) self.assertEqual(actual, expected)
def test_remove_version_from_href_3(self): fixture = 'http://www.testsite.com/v10.10' expected = 'http://www.testsite.com' actual = common.remove_version_from_href(fixture) self.assertEqual(expected, actual)
def test_remove_major_version_from_href(self): fixture = 'http://www.testsite.com/v1/images' expected = 'http://www.testsite.com/images' actual = common.remove_version_from_href(fixture) self.assertEqual(expected, actual)
def test_remove_version_from_href_2(self): fixture = "http://www.testsite.com/v1.1/" expected = "http://www.testsite.com/" actual = common.remove_version_from_href(fixture) self.assertEqual(expected, actual)