def test_getting_sizes_when_response_is_ok(self): api = AtmosphereAPI('token', base_url=self.mock_users_base_url) response = api.get_sizes() assert response.ok assert response.message['count'] == 6 and response.message['results'][ 0]['name'] == 'manila-service-flavor'
def test_getting_sizes_when_response_is_ok_and_filtering_on_provider(self): api = AtmosphereAPI('token', base_url=self.mock_users_base_url) response = api.get_sizes(provider_id=2) assert response.ok assert response.message['count'] == 0 and len( response.message['results']) == 0
def test_getting_sizes_when_response_is_not_ok(self): api = AtmosphereAPI('token', base_url=self.mock_users_bad_base_url) response = api.get_sizes() assert not response.ok