Skip to content

Commit

Permalink
Fix type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Godsmith committed Sep 3, 2023
1 parent 44a184f commit 6189ea5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/test_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def test_adding_rail_resets_signal_blocks(

assert len(game.signal_controller._signal_blocks) == 3

game.grid.create_rail([Rail(30, 0, 60, 0), Rail(60, 0, 90, 0)])
game.grid.create_rail({Rail(30, 0, 60, 0), Rail(60, 0, 90, 0)})

assert len(game.signal_controller._signal_blocks) == 2

Expand Down
10 changes: 5 additions & 5 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,19 @@ def _create_rails(grid: Grid, lines: list[str]):
if character in "-h":
x1, y1 = _coordinates(row_number, column_number - 1)
x2, y2 = _coordinates(row_number, column_number + 1)
grid.create_rail([Rail(x1, y1, x2, y2)])
grid.create_rail({Rail(x1, y1, x2, y2)})
elif character in "|v":
x1, y1 = _coordinates(row_number - 1, column_number)
x2, y2 = _coordinates(row_number + 1, column_number)
grid.create_rail([Rail(x1, y1, x2, y2)])
grid.create_rail({Rail(x1, y1, x2, y2)})
elif character == "/":
x1, y1 = _coordinates(row_number - 1, column_number - 1)
x2, y2 = _coordinates(row_number + 1, column_number + 1)
grid.create_rail([Rail(x1, y1, x2, y2)])
grid.create_rail({Rail(x1, y1, x2, y2)})
elif character == "\\":
x1, y1 = _coordinates(row_number - 1, column_number + 1)
x2, y2 = _coordinates(row_number + 1, column_number - 1)
grid.create_rail([Rail(x1, y1, x2, y2)])
grid.create_rail({Rail(x1, y1, x2, y2)})
if character in "hv":
grid.create_signals_at_grid_position(abs(x1 + x2) / 2, abs(y1 + y2) / 2)

Expand All @@ -58,7 +58,7 @@ def _remove_offset(lines: Iterable[str]):

def create_station_method(grid: Grid, east_west: bool) -> Callable[[Vec2], None]:
def inner(position: Vec2):
grid._create_station(Station(positions=(position,), east_west=east_west)),
grid._create_station(Station(positions=(position,), east_west=east_west))

return inner

Expand Down

0 comments on commit 6189ea5

Please sign in to comment.