def test_guess_auth_version_explicit_2(self): mock_opts = Mock() mock_opts.os_identity_api_version = '2.0' self.assertEquals(client.guess_auth_version(mock_opts), '2.0')
def test_guess_auth_version_implicit_2(self): mock_opts = Mock() mock_opts.os_auth_url = 'http://whatever/v2.0' self.assertEquals(client.guess_auth_version(mock_opts), '2.0')
def test_guess_auth_version_returns_none(self): mock_opts = Mock() mock_opts.os_identity_api_version = '' mock_opts.os_auth_url = '' self.assertIsNone(client.guess_auth_version(mock_opts))
def test_guess_auth_version_implicit_2(self): mock_opts = Mock() mock_opts.os_auth_url = 'http://whatever/v2.0' self.assertEquals(client.guess_auth_version(mock_opts), '2.0')
def test_guess_auth_version_explicit_2(self): mock_opts = Mock() mock_opts.os_identity_api_version = '2.0' self.assertEquals(client.guess_auth_version(mock_opts), '2.0')
def test_guess_auth_version_implicit_3(self): mock_opts = Mock() mock_opts.os_auth_url = 'http://whatever/v3' self.assertEqual('3', client.guess_auth_version(mock_opts))
def test_guess_auth_version_explicit_3(self): mock_opts = Mock() mock_opts.os_identity_api_version = '3' self.assertEqual('3', client.guess_auth_version(mock_opts))