|
@@ -100,17 +100,12 @@ async def _on_create_party_registration(payload):
|
|
return 'oadrCreatedPartyRegistration', payload
|
|
return 'oadrCreatedPartyRegistration', payload
|
|
|
|
|
|
|
|
|
|
-server = OpenADRServer(vtn_id=VTN_ID)
|
|
|
|
|
|
+server = OpenADRServer(vtn_id=VTN_ID, http_port=SERVER_PORT)
|
|
server.add_handler('on_create_party_registration', _on_create_party_registration)
|
|
server.add_handler('on_create_party_registration', _on_create_party_registration)
|
|
server.add_handler('on_poll', _on_poll)
|
|
server.add_handler('on_poll', _on_poll)
|
|
|
|
|
|
@pytest.fixture
|
|
@pytest.fixture
|
|
async def start_server():
|
|
async def start_server():
|
|
- runner = web.AppRunner(server.app)
|
|
|
|
- await runner.setup()
|
|
|
|
- site = web.TCPSite(runner, 'localhost', SERVER_PORT)
|
|
|
|
- await site.start()
|
|
|
|
- print("SERVER IS NOW RUNNING")
|
|
|
|
|
|
+ await server.run_async()
|
|
yield
|
|
yield
|
|
- print("SERVER IS NOW STOPPING")
|
|
|
|
- await runner.cleanup()
|
|
|
|
|
|
+ await server.stop()
|