Пример #1
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.ArtTest03
@dataset([DataSet("test-03")])
class ArtTest03(object):
    """
    TODO: put there comments about the dataset
    """

    def test_art_test_03_01(self):
        self.journey(
            _from="stop_area:TS3:SA:1",
            to="stop_area:TS3:SA:6",
            datetime="20041214T0700",
        )


@set_scenario({"test-03": {"scenario": "new_default"}})
class TestTest03NewDefault(ArtTest03, ArtemisTestFixture):
    pass


@set_scenario({"test-03": {"scenario": "experimental"}})
class TestTest03Experimental(ArtTest03, ArtemisTestFixture):
    pass
Пример #2
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.ProlongAuto
@dataset([DataSet("prolong-auto")])
class ProlongAuto(object):
    """
    The dataset provide service prolongation examples.

    This means that different vehicle journeys are actually the same physical vehicle.
    This can be seen with bus or tramway when their head sign changes along the way.
    It allows passengers to continue their journey while staying in the same vehicle.
    This is achieve in the data with the same `block_id` in trips.txt
    """

    def test_prolong_auto_01(self):
        self.journey(
            _from="stop_area:PRA:SA:1",
            to="stop_area:PRA:SA:5",
            datetime="20041213T0700",
        )

    def test_prolong_auto_02(self):
        self.journey(
            _from="stop_area:PRA:SA:1",
            to="stop_area:PRA:SA:9",
            datetime="20041213T0700",
            max_duration_to_pt=0,
        )
Пример #3
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.FreqParis
@dataset([DataSet("freqparis")])
class FreqParis(object):
    """
    TODO: put there comments about the dataset
    """

    def test_freqparis_01(self):
        self.journey(
            _from="stop_area:FQP:SA:defen",
            to="stop_area:FQP:SA:grest",
            datetime="20090922T0700",
        )

    def test_freqparis_02(self):
        self.journey(
            _from="stop_area:FQP:SA:defen",
            to="stop_area:FQP:SA:grest",
            datetime="20090922T2330",
        )

    def test_freqparis_03(self):
        self.journey(
            _from="stop_area:FQP:SA:defen",
            to="stop_area:FQP:SA:grest",
            datetime="20090922T2200",
Пример #4
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.NbCorr01
@dataset([DataSet("nb-corr-01")])
class NbCorr01(object):
    """
    TODO: put there comments about the dataset
    """
    def test_nb_corr_01_01(self):
        self.journey(
            _from="stop_area:NC1:SA:1",
            to="stop_area:NC1:SA:4",
            datetime="20041213T0700",
        )


@set_scenario({"nb-corr-01": {"scenario": "new_default"}})
class TestNbCorr01NewDefault(NbCorr01, ArtemisTestFixture):
    pass


@set_scenario({"nb-corr-01": {"scenario": "experimental"}})
class TestNbCorr01Experimental(NbCorr01, ArtemisTestFixture):
    pass
Пример #5
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Map
@dataset([DataSet("map")])
class Map(object):
    """
    test walk transfert
    """

    def test_map_01(self):
        """
        test walk journey
        """
        self.journey(
            _from="stop_area:MAP:SA:1",
            to="stop_area:MAP:SA:2",
            datetime="20041210T070000",
        )

    def test_map_02(self):
        """
        test walk transfert at start
        """
        self.journey(
            _from="stop_area:MAP:SA:1",
            to="stop_area:MAP:SA:3",
            datetime="20041210T070000",
        )
Пример #6
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.FreqGtfs_01
@dataset([DataSet("freqgtfs-01")])
class FreqGtfs_01(object):
    """
    test frequencies to stops serialisation by FUSiO
    """
    def test_freqgtfs_01_01(self):
        self.journey(
            _from="stop_area:FQT:SA:1374208",
            to="stop_area:FQT:SA:211435",
            datetime="20120905T062000",
        )

    def test_freqgtfs_01_02(self):
        self.journey(
            _from="stop_area:FQT:SA:527405",
            to="stop_area:FQT:SA:1344488",
            datetime="20120820T170000",
        )

    def test_freqgtfs_01_03(self):
        self.journey(
            _from="stop_area:FQT:SA:215949",
            to="stop_area:FQT:SA:212127",
            datetime="20121110T070000",
        )
Пример #7
0
from artemis import default_checker
from artemis.default_checker import stop_schedule_checker
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest

xfail = pytest.mark.xfail


@pytest.mark.Bibus
@dataset([DataSet("bibus")])
class Bibus(object):
    """
    """
    def test_bibus_01(self):
        self.journey(
            _from="stop_area:BIB:SA:527",
            to="stop_area:BIB:SA:9",
            datetime="20041214T070000",
            datetime_represents="arrival",
            walking_speed="0.83",
            max_duration_to_pt="1200",
        )

    def test_bibus_02(self):
        self.journey(
            _from="stop_area:BIB:SA:336",
            to="stop_area:BIB:SA:123",
            datetime="20041215T080000",
            datetime_represents="arrival",
            walking_speed="0.83",
Пример #8
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Boucle01
@dataset([DataSet("boucle-01")])
class Boucle01(object):
    """
    TODO: put there comments about the dataset
    """

    def test_boucle_01_01(self):
        self.journey(
            _from="stop_area:BC1:SA:1",
            to="stop_area:BC1:SA:6",
            datetime="20041213T0730",
        )

    def test_boucle_01_02(self):
        self.journey(
            _from="stop_area:BC1:SA:3",
            to="stop_area:BC1:SA:7",
            datetime="20041213T0730",
            max_duration_to_pt=100,
        )

    def test_boucle_01_03(self):
        self.journey(
            _from="stop_area:BC1:SA:8",
            to="stop_area:BC1:SA:5",
Пример #9
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.PasseMinuit02
@dataset([DataSet("passe-minuit-02")])
class PasseMinuit02(object):
    """
    TODO: put there comments about the dataset
    """
    def test_passe_minuit_02_01(self):
        self.journey(
            _from="stop_area:PM2:SA:1",
            to="stop_area:PM2:SA:2",
            datetime="20080310T2300",
        )

    def test_passe_minuit_02_02(self):
        self.journey(
            _from="stop_area:PM2:SA:1",
            to="stop_area:PM2:SA:4",
            datetime="20080310T2300",
        )

    def test_passe_minuit_02_03(self):
        """
        no solution found for this journey because first itinerary available is 2 days later
        """
        self.journey(
            _from="stop_area:PM2:SA:2",
Пример #10
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.ArtTest01
@dataset([DataSet("test-01")])
class ArtTest01(object):
    """
    TODO: put there comments about the dataset
    """
    def test_art_test_01_01(self):
        self.journey(
            _from="stop_area:TS1:SA:2",
            to="stop_area:TS1:SA:6",
            datetime="20041214T0700",
        )

    def test_art_test_01_02(self):
        self.journey(
            _from="stop_area:TS1:SA:10",
            to="stop_area:TS1:SA:12",
            datetime="20041214T0700",
        )


class TestTadExperimental(ArtTest01, ArtemisTestFixture):
    pass
Пример #11
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.TCL
@dataset([DataSet("tcl")])
class TCL(object):
    """
    TODO: put there comments about the dataset
    """
    def test_tcl_01(self):
        """
        ID artemis v1: 0
        """
        self.journey(
            _from="stop_area:TCL:SA:5520",
            to="stop_area:TCL:SA:5085",
            datetime="20090722T070000",
            walking_speed="0.83",
            max_duration_to_pt="240",
        )

    def test_tcl_02(self):
        """
        ID artemis v1: 8
        """
        self.journey(
            _from="stop_area:TCL:SA:5520",
            to="stop_area:TCL:SA:5085",
            datetime="20090722T120000",
Пример #12
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.MDI
@dataset([DataSet("mdi")])
class MDI(object):
    """
    TODO: put there comments about the dataset
    """
    def test_mdi_01(self):
        self.journey(
            _from="stop_area:MDI:SA:1",
            to="stop_area:MDI:SA:3",
            datetime="20070308T0700",
        )

    def test_mdi_02(self):
        self.journey(
            _from="stop_area:MDI:SA:1",
            to="stop_area:MDI:SA:4",
            datetime="20070308T0700",
        )

    def test_mdi_03(self):
        self.journey(
            _from="stop_area:MDI:SA:2",
            to="stop_area:MDI:SA:3",
            datetime="20070308T0700",
        )
Пример #13
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest
import datetime


@pytest.mark.SaintOmer
@dataset([DataSet("saintomer", reload_timeout=datetime.timedelta(minutes=3))])
class SaintOmer(object):
    """
      test "on demand transport"
    """
    def test_saint_omer_admin_to_poi(self):
        """
        ID artemis v1: 0 and 1
        """
        self.journey(
            _from="admin:fr:62595",
            to="poi:adm117",
            datetime="20121206T133500",
            walking_speed="1",
            max_duration_to_pt="1000",
        )

    def test_saint_omer_poi_to_admin(self):
        """
        ID artemis v1: 2
        """
        self.journey(
            _from="poi:adm117",
            to="admin:fr:62595",
Пример #14
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.FreqGtfs
@dataset([DataSet("freqgtfs")])
class FreqGtfs(object):
    """
    test frequencies to stops serialisation by FUSiO
    """
    def test_freqgtfs_01(self):
        self.journey(
            _from="stop_area:FQG:SA:35",
            to="stop_area:FQG:SA:1",
            datetime="20070417T054000",
        )

    def test_freqgtfs_02(self):
        self.journey(
            _from="stop_area:FQG:SA:35",
            to="stop_area:FQG:SA:1",
            datetime="20070417T050000",
        )

    def test_freqgtfs_03(self):
        self.journey(
            _from="stop_area:FQG:SA:35",
            to="stop_area:FQG:SA:1",
            datetime="20070417T010000",
        )
Пример #15
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Corr02
@dataset([DataSet("corr-02")])
class Corr02(object):
    """
    TODO: put there comments about the dataset
    """
    def test_corr_02_01(self):
        """
        This test shows that a third compute is necessary.
        The journey must be:
        13/12  15:00 Arret 1
        13/12  15:10 Arret 2
          transfert
        13/12  15:16 Arret 2
        13/12  15:24 Arret 3
          transfert
        13/12  15:40 Arret 3
        13/12  15:50 Arret 4
        """
        self.journey(
            _from="stop_area:CR2:SA:1",
            to="stop_area:CR2:SA:4",
            datetime="20041213T0700",
        )

Пример #16
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Tad
@dataset([DataSet("tad")])
class Tad(object):
    """
    On demand transport tests
    """
    """
    City to City
        > In this case, these are the frequencies that are used
    """
    def test_city_2_city(self):
        self.journey(_from="admin:fr:41246",
                     to="admin:fr:41266",
                     datetime="20150302T102000")

    # to is a coord in admin : admin:fr:41266
    def test_city_2_coord(self):
        self.journey(_from="admin:fr:41246",
                     to="1.2453;47.4713",
                     datetime="20150302T102000")

    # _from is a coord in admin : admin:fr:41246
    def test_coord_2_city(self):
        self.journey(_from="1.3379;47.5096",
                     to="admin:fr:41266",
                     datetime="20150302T102000")
Пример #17
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Corr01
@dataset([DataSet("corr-01")])
class Corr01:
    """
    """
    def test_corr_01_01(self):
        """
        no solution found for this journey because number of transfers > 10
        """
        self.journey(
            _from="stop_area:CR1:SA:1",
            to="stop_area:CR1:SA:13",
            datetime="20041210T0700",
            max_duration_to_pt=0,
        )

    def test_corr_01_02(self):
        self.journey(
            _from="stop_area:CR1:SA:1",
            to="stop_area:CR1:SA:13",
            datetime="20041210T0700",
            max_nb_transfers=11,
            max_duration_to_pt=0,
        )

Пример #18
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest

xfail = pytest.mark.xfail


@pytest.mark.Airport1
@dataset([DataSet("airport-01")])
class Airport1(object):
    """
    TODO: put there comments about the dataset
    """
    def test_airport_01_01(self):
        self.journey(
            _from="stop_area:AI1:SA:AIRPORTAIRPORT",
            to="stop_area:AI1:SA:AIRPORTLYS",
            datetime="20120904T0700",
        )

    def test_airport_01_02(self):
        self.journey(
            _from="stop_area:AI1:SA:AIRPORTAMS",
            to="stop_area:AI1:SA:AIRPORTAIRPORT",
            datetime="20120904T0900",
        )

    def test_airport_01_03(self):
        self.journey(
            _from="stop_area:AI1:SA:AIRPORTAIRPORT",
            to="stop_area:AI1:SA:AIRPORTCLY",
Пример #19
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest

xfail = pytest.mark.xfail


@pytest.mark.Auvergne
@dataset([DataSet("fr-auv")])
class Auvergne(object):
    """
    test for new_default with data from auvergne
    """
    def test_auvergne_01(self):
        """
        http://jira.canaltp.fr/browse/NAVITIAII-2020
        """
        self.journey(
            _from="poi:osm:node:303386067",
            to="3.0630843999999797;45.7589254",
            datetime="20160121T170000",
            first_section_mode=["bike", "bss", "walking", "car"],
            last_section_mode=["walking"],
            min_nb_journeys=3,
            max_duration_to_pt=1200,
        )

    def test_auvergne_02(self):
        """
        http://jira.canaltp.fr/browse/NAVITIAII-2016
        """
Пример #20
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.ProlongMano
@dataset([DataSet("prolong-mano")])
class ProlongMano(object):
    """
    TODO: put there comments about the dataset
    """
    def test_prolong_mano_01(self):
        self.journey(
            _from="stop_area:PRM:SA:1",
            to="stop_area:PRM:SA:5",
            datetime="20041213T0700",
        )

    def test_prolong_mano_02(self):
        self.journey(
            _from="stop_area:PRM:SA:1",
            to="stop_area:PRM:SA:9",
            datetime="20041213T0700",
        )

    def test_prolong_mano_03(self):
        self.journey(
            _from="stop_point:PRM:SP:Nav1",
            to="stop_point:PRM:SP:Nav4",
            datetime="20040101T100000",
        )
Пример #21
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest

xfail = pytest.mark.xfail


@pytest.mark.Sherbrooke
@dataset([DataSet("sherbrooke")])
class Sherbrooke(object):
    def test_sherbrooke_01(self):
        self.journey(
            _from="stop_area:STS:SA:387",
            to="poi:3815 - ADDRESS370 - ADDRESS1126",
            datetime="20111116T070000",
            datetime_represents="arrival",
            walking_speed="0.83",
            max_duration_to_pt="720",
        )

    def test_sherbrooke_02(self):
        self.journey(
            _from="poi:3713 - ADDRESS370 - ADDRESS1079",
            to="poi:3534 - ADDRESS968 - ADDRESS970",
            datetime="20111112T133000",
            walking_speed="0.83",
            max_duration_to_pt="720",
        )

    def test_sherbrooke_03(self):
        self.journey(
Пример #22
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Rebroussement
@dataset([DataSet("rebroussement")])
class Rebroussement(object):
    """
    TODO: put there comments about the dataset
    """

    def test_rebroussement_01(self):
        self.journey(
            _from="stop_area:RBR:SA:1",
            to="stop_area:RBR:SA:6",
            datetime="20041213T0700",
        )

    def test_rebroussement_02(self):
        self.journey(
            _from="stop_area:RBR:SA:1",
            to="stop_area:RBR:SA:3",
            datetime="20041213T0900",
        )

    def test_rebroussement_03(self):
        self.journey(
            _from="stop_area:RBR:SA:1",
            to="stop_area:RBR:SA:4",
            datetime="20041213T0900",
Пример #23
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.FreqSimple
@dataset([DataSet("freqsimple")])
class FreqSimple(object):
    """
    TODO: put there comments about the dataset
    """

    def test_freqsimple_01(self):
        self.journey(
            _from="stop_area:FQS:SA:GRA",
            to="stop_area:FQS:SA:MBC",
            datetime="20070417T0540",
        )

    def test_freqsimple_02(self):
        self.journey(
            _from="stop_area:FQS:SA:GRA",
            to="stop_area:FQS:SA:MBC",
            datetime="20070417T0500",
        )

    def test_freqsimple_03(self):
        self.journey(
            _from="stop_area:FQS:SA:MBC",
            to="stop_area:FQS:SA:GRA",
            datetime="20070417T0100",
Пример #24
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.ArtTest02
@dataset([DataSet("test-02")])
class ArtTest02(object):
    """
    TODO: put there comments about the dataset
    """
    def test_art_test_02_01(self):
        self.journey(
            _from="stop_area:TS2:SA:1",
            to="stop_area:TS2:SA:2",
            datetime="20041214T1100",
        )

    def test_art_test_02_02(self):
        self.journey(
            _from="stop_area:TS2:SA:1",
            to="stop_area:TS2:SA:3",
            datetime="20041214T1105",
        )

    def test_art_test_02_03(self):
        self.journey(
            _from="stop_area:TS2:SA:1",
            to="stop_area:TS2:SA:4",
            datetime="20041214T0700",
        )
Пример #25
0
from artemis.common_fixture import dataset, DataSet, set_scenario
from artemis.tests.fixture import ArtemisTestFixture
import pytest

xfail = pytest.mark.xfail


@pytest.mark.Itl
@dataset([DataSet("itl")])
class Itl(object):
    """
    test local traffic policy constraint
    """
    def test_itl_01(self):
        self.journey(
            _from="stop_area:ITL:SA:1",
            to="stop_area:ITL:SA:7",
            datetime="20041213T070000",
        )

    def test_itl_02(self):
        self.journey(
            _from="stop_area:ITL:SA:1",
            to="stop_area:ITL:SA:7",
            datetime="20041213T070100",
        )


@set_scenario({"itl": {"scenario": "new_default"}})
class TestItlNewDefault(Itl, ArtemisTestFixture):
    pass
Пример #26
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Mission
@dataset([DataSet("mission")])
class Mission(object):
    """
    TODO: put there comments about the dataset
    """
    def test_mission_01(self):
        self.journey(
            _from="stop_area:MIS:SA:1",
            to="stop_area:MIS:SA:5",
            datetime="20041210T090000",
        )

    def test_mission_02(self):
        self.journey(
            _from="stop_area:MIS:SA:1",
            to="stop_area:MIS:SA:7",
            datetime="20041210T090000",
        )

    def test_mission_03(self):
        self.journey(
            _from="stop_area:MIS:SA:1",
            to="stop_area:MIS:SA:8",
            datetime="20041210T090000",
        )
Пример #27
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.Poitiers
@dataset([DataSet("poitiers")])
class Poitiers(object):
    """
    """
    def test_poitiers_01(self):
        """
        ID artemis v1: 3
        """
        self.journey(
            _from="stop_area:POI:SA:10001",
            to="stop_area:POI:SA:10046",
            datetime="20091117T070000",
            walking_speed="0.83",
            max_duration_to_pt="240",
        )

    def test_poitiers_02(self):
        """
        ID artemis v1: 4
        """
        self.journey(
            _from="stop_area:POI:SA:10001",
            to="stop_area:POI:SA:10046",
            datetime="20091116T235000",
            walking_speed="0.83",
Пример #28
0
from artemis.common_fixture import dataset, DataSet
from artemis.tests.fixture import ArtemisTestFixture
import pytest


@pytest.mark.SaintOmer
@dataset([DataSet("saintomer")])
class SaintOmer(object):
    """
      test "on demand transport"
    """
    def test_saint_omer_admin_to_poi(self):
        """
        ID artemis v1: 0 and 1
        """
        self.journey(
            _from="admin:fr:62595",
            to="poi:adm117",
            datetime="20121206T133500",
            walking_speed="1",
            max_duration_to_pt="1000",
        )

    def test_saint_omer_poi_to_admin(self):
        """
        ID artemis v1: 2
        """
        self.journey(
            _from="poi:adm117",
            to="admin:fr:62595",
            datetime="20121206T153500",