Skip to content

Commit aad2fb9

Browse files
committed
Better test adaptation
1 parent af6cd0e commit aad2fb9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

tests/test_usb.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1711,9 +1711,7 @@ async def makedirs(cache_dir: str, exist_ok: bool) -> None:
17111711
mock_file_stream = MagicMock(readlines=lambda *args, **kwargs: file_chunks_iter)
17121712
with patch("aiofiles.threadpool.sync_open", return_value=mock_file_stream):
17131713
await pw_nw_cache.restore_cache()
1714-
assert pw_nw_cache.nodetypes == {
1715-
"0123456789ABCDEF": pw_api.NodeType.CIRCLE_PLUS,
1716-
}
1714+
assert pw_nw_cache.nodetypes == {}
17171715

17181716
# test with valid data
17191717
mock_read_data = [
@@ -1726,7 +1724,6 @@ async def makedirs(cache_dir: str, exist_ok: bool) -> None:
17261724
with patch("aiofiles.threadpool.sync_open", return_value=mock_file_stream):
17271725
await pw_nw_cache.restore_cache()
17281726
assert pw_nw_cache.nodetypes == {
1729-
"0123456789ABCDEF": pw_api.NodeType.CIRCLE_PLUS,
17301727
"FEDCBA9876543210": pw_api.NodeType.CIRCLE,
17311728
"1298347650AFBECD": pw_api.NodeType.SCAN,
17321729
}
@@ -1738,14 +1735,12 @@ async def makedirs(cache_dir: str, exist_ok: bool) -> None:
17381735
)
17391736
mock_file_stream.writelines.assert_called_with(
17401737
[
1741-
"0123456789ABCDEF;CIRCLE_PLUS\n",
17421738
"FEDCBA9876543210;CIRCLE\n",
17431739
"1298347650AFBECD;SCAN\n",
17441740
"1234ABCD4321FEDC;STEALTH\n",
17451741
]
17461742
)
17471743
assert pw_nw_cache.nodetypes == {
1748-
"0123456789ABCDEF": pw_api.NodeType.CIRCLE_PLUS,
17491744
"FEDCBA9876543210": pw_api.NodeType.CIRCLE,
17501745
"1298347650AFBECD": pw_api.NodeType.SCAN,
17511746
"1234ABCD4321FEDC": pw_api.NodeType.STEALTH,

0 commit comments

Comments
 (0)