Exemplo n.º 1
0
 def test_create_csv(self):
     testClass = ReadingSncfApi()
     testClass.read_links("stop_areas_tiph.json")
     testClass.my_id('id')
     testClass.my_name('label')
     testClass.my_coord('coord')
     testClass.csv_convert_info('Mon_csv.csv')
     my_boolean = (len(testClass.liste_id) > 0) and (len(
         testClass.liste_names) > 0) and (len(testClass.liste_coord) > 0)
     self.assertTrue(my_boolean)
     self.assertTrue(os.path.exists('mon_csv.csv'))
Exemplo n.º 2
0
 def test_stop_station_list(self):
     testClass = ReadingSncfApi()
     testClass.lyon_read_json()
     testClass.number_station()
     testClass.stops_name()
     self.assertTrue(len(testClass.station_paris_lyon) > 0)
Exemplo n.º 3
0
 def test_reading(self):
     testClass = ReadingSncfApi()  #je crée une classe
     testClass.read_json(
         'stop_areas.json')  #j'appelle la fonction de ma classe
     self.assertTrue(os.path.exists('stop_areas.json'))
Exemplo n.º 4
0
 def test_coord_list_full(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     testClass.my_coord("coord")
     self.assertTrue(len(testClass.liste_coord) > 0)
Exemplo n.º 5
0
 def test_name_list_full(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     testClass.my_name("label")
     self.assertTrue(len(testClass.liste_names) > 0)
Exemplo n.º 6
0
 def test_my_coord(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     testClass.my_coord("coord")
     self.assertTrue(type(testClass.liste_coord) == list)
Exemplo n.º 7
0
 def test_my_name(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     testClass.my_name("label")
     self.assertTrue(type(testClass.liste_names) == list)
Exemplo n.º 8
0
 def test_loop_links(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     testClass.loop_links('href')
     self.assertTrue(type(testClass.liste_links) == list)
Exemplo n.º 9
0
 def test_read_links(self):
     testClass = ReadingSncfApi()
     testClass.read_links('stop_areas_tiph.json')
     self.assertTrue(os.path.exists('stop_areas_tiph.json'))