test_*.py: Make tests pytest compatible

merge-requests/55/head
Fabian P. Schmidt 2019-11-06 13:27:27 +01:00
parent 9c709bcbc4
commit 1597131b4f
3 changed files with 8 additions and 9 deletions

View File

@ -1,6 +1,9 @@
from auto_scheduler.api import get_transmitter_stats, \
get_active_transmitter_info
import pytest
from satnogs_client import get_transmitter_stats, \
get_active_transmitter_info
@pytest.mark.skip(reason="SatNOGS API changed, only ['uuid', 'sync_to_db', 'stats'] is left.")
def test_get_transmitter_stats():
transmitters = get_transmitter_stats()

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from datetime import datetime
import logging
import settings
@ -8,7 +6,7 @@ from cache import CacheManager
from satnogs_client import get_groundstation_info
if __name__ == '__main__':
def test_cache():
logging.basicConfig(level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")

View File

@ -1,5 +1,3 @@
#!/usr/bin/env python3
from tqdm import tqdm
from datetime import datetime
from cache import CacheManager
@ -43,7 +41,7 @@ ground_station = {'altitude': 280,
passes_0 = {'mytime': '2019/11/5 12:07:10', 'name': 'SPOOQY-1', 'id': '44332', 'tle1': '1 44332U 98067QH 19306.08869167 .00007980 00000-0 12906-3 0 9995\n', 'tle2': '2 44332 51.6412 35.2671 0005344 234.5067 125.5425 15.53818829 21405\n', 'tr': datetime(2019, 11, 5, 12, 22, 27, 60922), 'azr': '319', 'tt': datetime(2019, 11, 5, 12, 26, 26, 616777), 'altt': '30', 'ts': datetime(2019, 11, 5, 12, 30, 24, 387405), 'azs': '100', 'valid': False, 'uuid': '4rK9bvm9bm7BLypA69EnEh', 'success_rate': 0.79, 'good_count': 1754, 'data_count': 2195, 'mode': 'GMSK9k6', 'scheduled': False}
if __name__ == '__main__':
def test_predictor():
cache = CacheManager(ground_station['id'],
ground_station['antenna'],
cache_dir='./tests/cache',
@ -68,7 +66,7 @@ if __name__ == '__main__':
# Loop over satellites
passes = []
for satellite in tqdm(satellites):
for satellite in satellites:
passes.extend(find_passes(satellite,
observer,
tmin,