Example #1
0
 def test_stop_service(self):
     reg = InMemoryServiceRegistry()
     server = mock.Mock()
     reg.register(SecondaryService(service_metadata=dummy_service_metadata, host='oeo.net', port=5678, server=server))
     # Stop service
     reg.stop_service('s1234')
     server.stop.assert_called_with()
     # service should be gone now
     with pytest.raises(ServiceNotFoundException):
         reg.get_metadata('s1234')
     with pytest.raises(ServiceNotFoundException):
         reg.stop_service('s1234')
Example #2
0
 def test_stop_service(self):
     reg = InMemoryServiceRegistry()
     server = mock.Mock()
     reg.register(dummy_service_metadata.id, SecondaryService(host='oeo.net', port=5678, server=server))
     reg.persist(user_id='u9876', metadata=dummy_service_metadata, api_version="0.4.0")
     # Stop service
     reg.stop_service('u9876', 's1234')
     server.stop.assert_called_with()
     # service should be gone now
     with pytest.raises(ServiceNotFoundException):
         reg.get_metadata('u9876', 's1234')
     with pytest.raises(ServiceNotFoundException):
         reg.stop_service('u9876', 's1234')