Esempio n. 1
0
    def test_delete_docking_station(self):
        docking_station = DockingStation.create(-90.350, -1.133)
        docking_station_id = docking_station.id
        self.assertIsNotNone(docking_station)

        docking_station.delete()
        db_docking_station = DockingStation.get(docking_station_id)
        self.assertIsNone(db_docking_station)
Esempio n. 2
0
    def test_create_docking_station(self):
        longitude = -90.200391
        latitude = -1.163508
        docking_station = DockingStation.create(longitude, latitude)

        db_docking_station = DockingStation.get(docking_station.id)
        self.assertIsNotNone(db_docking_station)
        self.assertEqual(db_docking_station.longitude, longitude)
        self.assertEqual(db_docking_station.latitude, latitude)
        self.assertIsNotNone(db_docking_station.created_ts)
        self.assertIsNone(db_docking_station.modified_ts)
        self.assertEqual((type(db_docking_station.geo)), WKBElement)
Esempio n. 3
0
 def test_get_nonexistent_docking_station(self):
     docking_station = DockingStation.get(100)
     self.assertIsNone(docking_station)
Esempio n. 4
0
    def test_get_docking_station(self):
        docking_station = DockingStation.create(-90.3370, -1.3625)
        docking_station_id = docking_station.id

        db_docking_station = DockingStation.get(docking_station_id)
        self.assertEqual(db_docking_station.id, docking_station_id)