Skip to content

Commit

Permalink
test(buses): 新增 /buses/current/ 各端口測試
Browse files Browse the repository at this point in the history
  • Loading branch information
iwtba4188 committed Dec 16, 2023
1 parent ab20054 commit d391c94
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_buses.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,27 @@ def test_buses_stops(stop_name, bus_type, day, direction):
def test_buses_detailed(bus_type, day, direction):
response = client.get(url=f"/buses/detailed/{bus_type}/{day}/{direction}")
assert response.status_code == 200


@pytest.mark.parametrize("bus_type", [_.value for _ in schemas.buses.BusType])
@pytest.mark.parametrize("direction", [_.value for _ in schemas.buses.BusDirection])
def test_current_schedules(bus_type, direction):
response = client.get(url=f"/buses/current/schedules/{bus_type}/{direction}")
assert response.status_code == 200


@pytest.mark.parametrize("stop_name", [_.value for _ in schemas.buses.StopsName])
@pytest.mark.parametrize("bus_type", [_.value for _ in schemas.buses.BusType])
@pytest.mark.parametrize("direction", [_.value for _ in schemas.buses.BusDirection])
def test_current_buses_stops(stop_name, bus_type, direction):
response = client.get(
url=f"/buses/current/stops/{stop_name}/{bus_type}/{direction}"
)
assert response.status_code == 200


@pytest.mark.parametrize("bus_type", [_.value for _ in schemas.buses.BusType])
@pytest.mark.parametrize("direction", [_.value for _ in schemas.buses.BusDirection])
def test_buses_detailed(bus_type, direction):
response = client.get(url=f"/buses/current/detailed/{bus_type}/{direction}")
assert response.status_code == 200

0 comments on commit d391c94

Please sign in to comment.