Created
April 25, 2019 18:42
-
-
Save cooper6581/467f982a0a44494ca32d0c2f755112bc to your computer and use it in GitHub Desktop.
nova url format test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mock.patch.object(cell_mapping.CellMapping, '_get_by_uuid_from_db') | |
def test_non_formatted_url_with_base(self, mock_get): | |
# Make sure we just pass through the template URL if the base | |
# URLs are set, i.e. we don't try to format the URL to a template. | |
url = 'foo{' | |
self.flags(transport_url=url) | |
self.flags(connection=None, group='database') | |
db_mapping = get_db_mapping(transport_url=url, | |
database_connection=url) | |
mock_get.return_value = db_mapping | |
mapping_obj = objects.CellMapping().get_by_uuid(self.context, | |
db_mapping['uuid']) | |
self.assertEqual(url, mapping_obj.database_connection) | |
self.assertEqual(url, mapping_obj.transport_url) | |
mock_format.assert_not_called() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment