pull/78/head
Konstantin Gründger 2019-11-26 22:43:06 +01:00
rodzic 491e816652
commit 57654f62f0
6 zmienionych plików z 8 dodań i 3 usunięć

Wyświetl plik

@ -123,8 +123,8 @@ def update_entries(session, start, end, logger=None):
# ... and take the nearest airport
sq6 = (
session.query(sq5.c.timestamp, sq5.c.track, sq5.c.is_takeoff, sq5.c.device_id, sq5.c.airport_id)
.distinct(sq5.c.timestamp, sq5.c.track, sq5.c.is_takeoff, sq5.c.address)
.order_by(sq5.c.timestamp, sq5.c.track, sq5.c.is_takeoff, sq5.c.address, sq5.c.airport_distance)
.distinct(sq5.c.timestamp, sq5.c.track, sq5.c.is_takeoff, sq5.c.device_id)
.order_by(sq5.c.timestamp, sq5.c.track, sq5.c.is_takeoff, sq5.c.device_id, sq5.c.airport_distance)
.subquery()
)

Wyświetl plik

@ -1,5 +1,6 @@
SQLALCHEMY_DATABASE_URI = "postgresql://postgres@localhost:5432/ogn_test"
SQLALCHEMY_TRACK_MODIFICATIONS = False
SQLALCHEMY_ECHO = True
# Celery stuff
CELERY_BROKER_URL = "redis://localhost:6379/0"

Wyświetl plik

@ -48,7 +48,7 @@ setup(
'psycopg2-binary==2.8.4',
'mgrs==1.3.5',
'xmlunittest==0.5.0',
'flower==0.9.3'
'flower==0.9.3',
'tqdm==4.39.0',
'requests==2.22.0',
],

Wyświetl plik

@ -36,6 +36,7 @@ class TestOGNrange(TestBaseDB):
db.session.add(self.ab02)
db.session.commit()
@unittest.skip('stats will replaced by timescaledb aggregates')
def test_update_receiver_coverage(self):
update_entries(db.session, date=date(2017, 12, 10))

Wyświetl plik

@ -33,6 +33,7 @@ class TestStats(TestBaseDB):
db.session.add(self.d01)
db.session.commit()
@unittest.skip('stats will replaced by timescaledb aggregates')
def test_create_device_stats(self):
# Compute 1st beacon
self.ab01.device = self.d01

Wyświetl plik

@ -162,6 +162,7 @@ class TestTakeoffLanding(TestBaseDB):
db.session.execute(
"INSERT INTO aircraft_beacons(name, receiver_name, address, aircraft_type, location, altitude, timestamp, track, ground_speed, climb_rate, turn_rate) VALUES('FLRDDEFF7', 'Koenigsdf', 'DDEFF7', 'GLIDER_OR_MOTOR_GLIDER','0101000020E610000013AB192CAFEF264074029A081BEA4740',603,'2016-07-02 10:50:16',0,0,-0.096520193,0)"
)
db.session.execute("UPDATE aircraft_beacons SET agl = altitude - 602;")
db.session.commit()
# find the takeoff and the landing
@ -386,6 +387,7 @@ class TestTakeoffLanding(TestBaseDB):
db.session.execute(
"INSERT INTO aircraft_beacons(name, receiver_name, address, aircraft_type, location, altitude, timestamp, track, ground_speed, climb_rate, turn_rate) VALUES('FLRDDAC7C','Koenigsd2','DDAC7C','GLIDER_OR_MOTOR_GLIDER','0101000020E61000001FF46C567DEE2640A01A2FDD24EA4740',593,'2019-04-13 09:25:59',0,0,-0.096519999,0)"
)
db.session.execute("UPDATE aircraft_beacons SET agl = altitude - 602;")
db.session.commit()
# find the takeoff and the landing