Skip to content

Commit bdeeb18

Browse files
committed
chore: add test
1 parent a55ed9e commit bdeeb18

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_containers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Test cases for the containers module."""
22

3+
import copy
34
from dataclasses import dataclass
45
from typing import Any
56

@@ -481,3 +482,14 @@ def test_multi_maps_list_info(snapshot: SnapshotAssertion) -> None:
481482
deserialized = MultiMapsList.from_dict(data)
482483
assert isinstance(deserialized, MultiMapsList)
483484
assert deserialized == snapshot
485+
486+
487+
def test_accurate_map_flag() -> None:
488+
"""Test that we parse the map flag accurately."""
489+
s = S7MaxVStatus.from_dict(STATUS)
490+
assert s.current_map == 0
491+
status = copy.deepcopy(STATUS)
492+
# 252 is a code for no map, it should end up being 63.
493+
status["map_status"] = 252
494+
s = S7MaxVStatus.from_dict(status)
495+
assert s.current_map == 63

0 commit comments

Comments
 (0)