Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Jan 8, 2023
1 parent bc7e3f0 commit b9cef7e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/test_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ def test_connect_disconnect_is_called_for_each_client(screen: Screen):
@ui.page('/')
def page(client: Client):
ui.label(f'client id: {client.id}')
ui.on_connect(lambda c: events.append(f'|connect {c.id}|'))
ui.on_disconnect(lambda c: events.append(f'|disconnect {c.id}|'))
ui.on_connect(lambda c: events.append(f'connect {c.id}'))
ui.on_disconnect(lambda c: events.append(f'disconnect {c.id}'))

screen.open('/')
screen.open('/')
screen.open('/')
screen.wait(0.1)
assert len(events) == 5
assert events[0].startswith('|connect ')
assert events[1].startswith('|disconnect ')
assert events[2].startswith('|connect ')
assert events[3].startswith('|disconnect ')
assert events[4].startswith('|connect ')
assert events[0].startswith('connect ')
assert events[1].startswith('disconnect ')
assert events[2].startswith('connect ')
assert events[3].startswith('disconnect ')
assert events[4].startswith('connect ')

0 comments on commit b9cef7e

Please sign in to comment.