def import_airports(path="tests/SeeYou.cup"): """Import airports from a ".cup" file""" print("Import airports from '{}'...".format(path)) airports = get_airports(path) db.session.bulk_save_objects(airports) db.session.commit() db.session.execute("UPDATE airports SET border = ST_Expand(location, 0.05)") db.session.commit() print("Imported {} airports.".format(len(airports)))
def test_get_airports(self): airports = get_airports(os.path.dirname(__file__) + "/SeeYou.cup") self.assertGreater(len(airports), 1000)