def test_setup_endpoint(self): self.patch_object(dmapi.DmapiCharm, 'service_name', new_callable=mock.PropertyMock) self.patch_object(dmapi.DmapiCharm, 'region', new_callable=mock.PropertyMock) self.patch_object(dmapi.DmapiCharm, 'public_url', new_callable=mock.PropertyMock) self.patch_object(dmapi.DmapiCharm, 'internal_url', new_callable=mock.PropertyMock) self.patch_object(dmapi.DmapiCharm, 'admin_url', new_callable=mock.PropertyMock) self.service_name.return_value = 'type1' self.region.return_value = 'region1' self.public_url.return_value = 'public_url' self.internal_url.return_value = 'internal_url' self.admin_url.return_value = 'admin_url' keystone = mock.MagicMock() dmapi.setup_endpoint(keystone) keystone.register_endpoints.assert_called_once_with( 'type1', 'region1', 'public_url', 'internal_url', 'admin_url')
def setup_endpoint(keystone): dmapi.configure_ssl() dmapi.setup_endpoint(keystone) dmapi.assess_status()