async def test_stop_server(MockServer) -> None: """Hub should stop a server when stopped.""" hub = Hub("1.2.3.4", "1234", "token", True) await hub.start() assert MockServer.return_value.start.called is True hub.stop() assert MockServer.return_value.stop.called is True
def test_stop_server(self, MockServer) -> None: """Hub should stop a server when stopped.""" hub = Hub("1.2.3.4", "1234", "token", True) run(hub.start()) self.assertTrue(MockServer.return_value.start.called) hub.stop() self.assertTrue(MockServer.return_value.stop.called)