Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
assert client.log.pop() == {
'status': 'error',
'error': c.ERR_INVALID_EVENT,
}
await session.on_client_event({'event': None})
assert client.log.pop() == {
'status': 'error',
'error': c.ERR_INVALID_EVENT,
}
await session.on_client_event({'event': ''})
assert client.log.pop() == {
'status': 'error',
'event': '',
'error': c.ERR_EVENT_NOT_FOUND,
}
await session.on_client_event({'event': 'hello'})
assert client.log.pop() == {
'status': 'error',
'event': 'hello',
'error': c.ERR_EVENT_NOT_FOUND,
}
assert not client.log
async def process(self):
raise EventError(c.ERR_EVENT_NOT_FOUND)