def test_7(self): """ Tests symmetric bike network and write_tmx """ hints = {'idx':'name', 'lat':'y', 'lon':'x'} transit_matrix_1 = TransitMatrix('bike', primary_input='tests/test_data/sources.csv', primary_hints=hints, secondary_hints=hints) transit_matrix_1.process() filename = self.datapath + "test_7.tmx" transit_matrix_1.write_tmx(filename) transit_matrix_2 = TransitMatrix('walk', read_from_file=filename) assert True
def test_24(self): """ Tests write_tmx (asymmetric). """ hints = {'idx':'name', 'lat':'y', 'lon':'x'} transit_matrix_1 = TransitMatrix('bike', primary_input='tests/test_data/sources.csv', secondary_input='tests/test_data/dests.csv', primary_hints=hints, secondary_hints=hints) transit_matrix_1.process() filename = self.datapath + 'test_24_file.tmx' transit_matrix_1.write_tmx(filename) transit_matrix_2 = TransitMatrix('bike', read_from_file=filename) assert True
def test_25(self): """ Tests write file with bad filename (symmetric). """ hints = {'idx':'name', 'lat':'y', 'lon':'x'} transit_matrix_1 = TransitMatrix('walk', primary_input='tests/test_data/sources.csv', primary_hints=hints) transit_matrix_1.process() bad_filename = self.datapath + 'test_25_file.ext' try: transit_matrix_1.write_tmx(bad_filename) assert False except WriteTMXFailedException: return