Add unit test for provide_gnocchi_url

This commit is contained in:
James Page 2017-07-10 16:46:42 +01:00
parent cb0b925679
commit 233cfde079
1 changed files with 8 additions and 0 deletions

View File

@ -117,3 +117,11 @@ class TestHandlers(test_utils.PatchHelper):
mock_hookenv.service_name.return_value = 'gnocchi'
handlers.storage_ceph_disconnected()
mock_ceph_helper.delete_keyring.assert_called_once_with('gnocchi')
def test_provide_gnocchi_url(self):
mock_gnocchi = mock.MagicMock()
self.gnocchi_charm.public_url = "http://gnocchi:8041"
handlers.provide_gnocchi_url(mock_gnocchi)
mock_gnocchi.set_gnocchi_url.assert_called_once_with(
"http://gnocchi:8041"
)