kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Tweak tests so landing notifications work
rodzic
243a89b42b
commit
29e704996e
|
@ -117,6 +117,8 @@ class EmailNotification(object):
|
||||||
""" Process a new telemmetry dict, and send an e-mail if it is a new sonde. """
|
""" Process a new telemmetry dict, and send an e-mail if it is a new sonde. """
|
||||||
_id = telemetry["id"]
|
_id = telemetry["id"]
|
||||||
|
|
||||||
|
print(telemetry)
|
||||||
|
|
||||||
if _id not in self.sondes:
|
if _id not in self.sondes:
|
||||||
self.sondes[_id] = {
|
self.sondes[_id] = {
|
||||||
"last_time": time.time(),
|
"last_time": time.time(),
|
||||||
|
@ -495,10 +497,10 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
_test = {
|
_test = {
|
||||||
"id": "N1234557",
|
"id": "N1234557",
|
||||||
"frame": 10,
|
"frame": 11,
|
||||||
"lat": -10.01,
|
"lat": -10.01,
|
||||||
"lon": 10.01,
|
"lon": 10.01,
|
||||||
"alt": 800,
|
"alt": 1100,
|
||||||
"temp": 1.0,
|
"temp": 1.0,
|
||||||
"type": "RS41",
|
"type": "RS41",
|
||||||
"freq": "401.520 MHz",
|
"freq": "401.520 MHz",
|
||||||
|
@ -510,11 +512,14 @@ if __name__ == "__main__":
|
||||||
}
|
}
|
||||||
|
|
||||||
print("Testing landing alert.")
|
print("Testing landing alert.")
|
||||||
for i in range(20):
|
for i in range(30):
|
||||||
_email_notification.add(_test)
|
_tosubmit = _test.copy()
|
||||||
_test["alt"] = _test["alt"] - 5.0
|
_email_notification.add(_tosubmit)
|
||||||
|
_test["alt"] = _test["alt"] - 10.0
|
||||||
|
_test["lat"] = _test["lat"] + 0.001
|
||||||
|
_test["lon"] = _test["lon"] + 0.001
|
||||||
_test["datetime_dt"] = datetime.datetime.utcnow()
|
_test["datetime_dt"] = datetime.datetime.utcnow()
|
||||||
time.sleep(2)
|
time.sleep(1)
|
||||||
|
|
||||||
time.sleep(60)
|
time.sleep(60)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue