コード例 #1
0
def test_write_matsim_schedule_produces_semantically_equal_xml_to_input_matsim_xml(
        network_object_from_test_data, tmpdir):
    matsim_xml_writer.write_matsim_schedule(
        tmpdir, network_object_from_test_data.schedule)

    xml_diff.assert_semantically_equal(os.path.join(tmpdir, 'schedule.xml'),
                                       pt2matsim_schedule_file)
コード例 #2
0
def test_write_matsim_vehicles_produces_semantically_equal_xml_to_input_matsim_xml(
        network_object_from_test_data, tmpdir):
    network = network_object_from_test_data
    matsim_xml_writer.write_matsim_schedule(tmpdir, network.schedule)
    matsim_xml_writer.write_vehicles(tmpdir, network.schedule.vehicles,
                                     network.schedule.vehicle_types)

    xml_diff.assert_semantically_equal(os.path.join(tmpdir, 'vehicles.xml'),
                                       pt2matsim_vehicles_file)
コード例 #3
0
def test_write_matsim_schedule_produces_semantically_equal_xml_to_input_matsim_xml_if_stops_need_to_reprojected(
        network_object_from_test_data, tmpdir):
    # we change all the stops in the one service and one route that exists in the test data
    network_object_from_test_data.schedule.route(
        'VJbd8660f05fe6f744e58a66ae12bd66acbca88b98').reproject('epsg:3035')

    matsim_xml_writer.write_matsim_schedule(
        tmpdir, network_object_from_test_data.schedule)

    xml_diff.assert_semantically_equal(os.path.join(tmpdir, 'schedule.xml'),
                                       pt2matsim_schedule_file)