Skip to content

Commit

Permalink
Fixed tests on a slower machine
Browse files Browse the repository at this point in the history
  • Loading branch information
stan-janssen committed Feb 1, 2023
1 parent 7d427f0 commit 2c71304
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
23 changes: 11 additions & 12 deletions test/integration_tests/test_event_warnings_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,10 @@ async def test_client_no_event_handler(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=partial(on_event_accepted, future=event_confirm_future))

print("Waiting for a response to the event")
result = await event_confirm_future
assert result == 'optOut'
Expand Down Expand Up @@ -83,7 +82,7 @@ async def test_client_faulty_event_handler(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=partial(on_event_accepted, future=event_confirm_future))
Expand Down Expand Up @@ -120,7 +119,7 @@ async def test_client_exception_event_handler(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=partial(on_event_accepted, future=event_confirm_future))
Expand Down Expand Up @@ -160,7 +159,7 @@ async def test_client_good_event_handler(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=partial(on_event_accepted, future=event_confirm_future))
Expand Down Expand Up @@ -189,7 +188,7 @@ async def test_server_warning_conflicting_poll_methods(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=on_event_accepted)
Expand All @@ -211,7 +210,7 @@ async def test_server_warning_naive_datetimes_in_event(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=on_event_accepted)
Expand Down Expand Up @@ -319,7 +318,7 @@ async def test_client_warning_no_update_event_handler(caplog):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=event_accepted_future)
Expand All @@ -336,7 +335,7 @@ async def test_client_warning_no_update_event_handler(caplog):
server.events['venid'][0].event_descriptor.modification_number = 1
server.events_updated['venid'] = True

await asyncio.sleep(1)
await asyncio.sleep(2)
assert ("An Event was updated, but you don't have an on_updated_event handler configured. "
"You should implement your own on_update_event handler. This handler receives "
"an Event dict and should return either 'optIn' or 'optOut' based on your "
Expand All @@ -359,7 +358,7 @@ def dummy_callback(some_param):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
callback=dummy_callback)
Expand All @@ -377,7 +376,7 @@ def dummy_callback(some_param):
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'})
assert ("You did not provide a 'callback', which means you won't know if the "
Expand All @@ -395,7 +394,7 @@ async def test_server_add_event_with_no_callback_response_never_required(caplog)
signal_name='simple',
signal_type='level',
intervals=[{'dtstart': datetime.now(timezone.utc),
'duration': timedelta(seconds=1),
'duration': timedelta(hours=1),
'signal_payload': 1.1}],
target={'ven_id': 'venid'},
response_required='never')
Expand Down
18 changes: 0 additions & 18 deletions test/test_fingerprint_cmdline.py

This file was deleted.

0 comments on commit 2c71304

Please sign in to comment.