def test_update_magnum_service_regular(self):
        p_task = periodic.MagnumServicePeriodicTasks(CONF, 'fake-conductor')
        p_task.magnum_service_ref = self.fake_ms

        p_task.update_magnum_service(None)

        self.fake_ms_refresh.assert_called_once_with()
    def test_update_magnum_service_on_restart(self, mock_ms_create,
                                              mock_ms_get):
        p_task = periodic.MagnumServicePeriodicTasks(CONF, 'fake-conductor')
        mock_ms_get.return_value = self.fake_ms

        p_task.update_magnum_service(None)

        mock_ms_get.assert_called_once_with(mock.ANY, p_task.host,
                                            p_task.binary)
        self.fake_ms_refresh.assert_called_once_with()