Skip to content

Commit

Permalink
Get coverage up to 100%
Browse files Browse the repository at this point in the history
  • Loading branch information
puddly committed May 2, 2024
1 parent 61658a5 commit 20378f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/test_ash.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def write(self, data: bytes) -> None:

class FakeTransportRandomLoss(FakeTransport):
def write(self, data: bytes) -> None:
if random.random() < 0.25:
if random.random() < 0.20:
return

for byte in data:
Expand Down Expand Up @@ -584,3 +584,8 @@ async def test_ash_end_to_end(transport_cls: type[FakeTransport]) -> None:
host.send_reset()
await asyncio.sleep(0.01)
await host.send_data(b"test")

# Trigger a failure caused by excessive NAKs
with patch.object(ncp, "nak_state", True):
with pytest.raises(ash.NotAcked):
await host.send_data(b"ncp NAKing until failure")

Check failure on line 591 in tests/test_ash.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.8.14

test_ash_end_to_end[FakeTransportRandomLoss] asyncio.exceptions.TimeoutError

Check failure on line 591 in tests/test_ash.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.9.15

test_ash_end_to_end[FakeTransportRandomLoss] asyncio.exceptions.TimeoutError

Check failure on line 591 in tests/test_ash.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.10.8

test_ash_end_to_end[FakeTransportRandomLoss] asyncio.exceptions.TimeoutError

Check failure on line 591 in tests/test_ash.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.11.0

test_ash_end_to_end[FakeTransportRandomLoss] TimeoutError

Check failure on line 591 in tests/test_ash.py

View workflow job for this annotation

GitHub Actions / shared-ci / Run tests Python 3.12

test_ash_end_to_end[FakeTransportRandomLoss] TimeoutError

0 comments on commit 20378f6

Please sign in to comment.