def test__sets_global_labels(self): mock_set_global_labels = self.patch(eventloop, "set_global_labels") fake_eventloop = Mock() services = MAASServices(fake_eventloop) yield services.startService() mock_set_global_labels.assert_called_once_with(maas_uuid=ANY, service_type="region")
def test__starts_each_service(self): fake_eventloop = Mock() fake_eventloop.prepare = Mock() calls = Mock() fake_services = [Mock(), Mock()] services = MAASServices(fake_eventloop) for service in fake_services: service.startService = calls services.addService(service) yield services.startService() self.assertThat(calls, MockCallsMatch(call(), call())) self.assertThat(services.running, Equals(1))