Skip to content
Snippets Groups Projects
Commit 419a8e9c authored by u214892's avatar u214892
Browse files

#62 increase unit test coverage

parent fcb93ed3
No related branches found
No related tags found
No related merge requests found
...@@ -41,7 +41,7 @@ def test_rotate_railenv_transition(): ...@@ -41,7 +41,7 @@ def test_rotate_railenv_transition():
# | # |
# | # |
# int('0001001000000000', 2), # int('0001001000000000', 2),\ # noqa: E800
# Case 2 - simple left switch # Case 2 - simple left switch
# _ _| # _ _|
...@@ -57,12 +57,19 @@ def test_rotate_railenv_transition(): ...@@ -57,12 +57,19 @@ def test_rotate_railenv_transition():
# | # |
# | # |
# | # |
# int('1100000000100010', 2)]
# int('1000010000100001', 2), # Case 3 - diamond drossing # int('1100000000100010', 2) \ # noqa: E800
# int('1001011000100001', 2), # Case 4 - single slip
# int('1100110000110011', 2), # Case 5 - double slip # Case 3 - diamond drossing
# int('0101001000000010', 2), # Case 6 - symmetrical # int('1000010000100001', 2), \ # noqa: E800
# int('0010000000000000', 2), # Case 7 - dead end # Case 4 - single slip
# int('1001011000100001', 2), \ # noqa: E800
# Case 5 - double slip
# int('1100110000110011', 2), \ # noqa: E800
# Case 6 - symmetrical
# int('0101001000000010', 2), \ # noqa: E800
# Case 7 - dead end
# int('0010000000000000', 2), \ # noqa: E800
] ]
...@@ -72,8 +79,8 @@ def test_rotate_railenv_transition(): ...@@ -72,8 +79,8 @@ def test_rotate_railenv_transition():
expected_transition = cycle[i % len(cycle)] expected_transition = cycle[i % len(cycle)]
try: try:
assert actual_transition == expected_transition, \ assert actual_transition == expected_transition, \
"Case {}: rotate_transition({}, {}) should equal {} but was {}." \ "Case {}: rotate_transition({}, {}) should equal {} but was {}.".format(
.format(i, cycle[0], i, expected_transition, actual_transition) i, cycle[0], i, expected_transition, actual_transition)
except Exception as e: except Exception as e:
print("expected:") print("expected:")
rail_env_transitions.print(expected_transition) rail_env_transitions.print(expected_transition)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment