Esempio n. 1
0
async def test__move_with_emergency_stop(data, monkeypatch):
    monkeypatch.setattr(BaseItinerary, "required_keys", fake_required_keys)
    monkeypatch.setattr(BaseItinerary, "stations",
                        fake_stations_emergency_stop)
    base_itinerary = BaseItinerary(data)
    await base_itinerary.move()
    assert base_itinerary.get_answers() == []
Esempio n. 2
0
def test__stations(data, monkeypatch):
    monkeypatch.setattr(BaseItinerary, "required_keys", fake_required_keys)
    with pytest.raises(NotImplementedError):
        BaseItinerary(data).stations()
Esempio n. 3
0
async def test__move(data, monkeypatch):
    monkeypatch.setattr(BaseItinerary, "required_keys", fake_required_keys)
    monkeypatch.setattr(BaseItinerary, "stations", fake_stations)
    base_itinerary = BaseItinerary(data)
    await base_itinerary.move()
    assert base_itinerary.get_answers() == [ANSWER]
Esempio n. 4
0
async def test__move(data, monkeypatch):
    monkeypatch.setattr(BaseItinerary, "required_keys", fake_required_keys)
    base_itinerary = BaseItinerary(data)
    assert base_itinerary.train.data == data
Esempio n. 5
0
def test__data_has_required_keys_not_correct(data, monkeypatch):
    monkeypatch.setattr(BaseItinerary, "required_keys",
                        fake_required_keys_not_correct)
    base_itinerary = BaseItinerary(data)
    assert base_itinerary.data_has_required_keys() is False
Esempio n. 6
0
def test__required_keys(data):
    with pytest.raises(NotImplementedError):
        BaseItinerary(data)