From f65ffd13f75e623717011b2311ace359f4e6bf9d Mon Sep 17 00:00:00 2001 From: Junzi Sun Date: Sat, 14 Nov 2020 22:05:48 +0100 Subject: [PATCH] add tests --- tests/test_allcall.py | 13 +++++++++++++ tests/test_surv.py | 22 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 tests/test_allcall.py create mode 100644 tests/test_surv.py diff --git a/tests/test_allcall.py b/tests/test_allcall.py new file mode 100644 index 0000000..e727d4b --- /dev/null +++ b/tests/test_allcall.py @@ -0,0 +1,13 @@ +from pyModeS import allcall + + +def test_icao(): + assert allcall.icao("5D484FDEA248F5") == "484FDE" + + +def test_interrogator(): + assert allcall.interrogator("5D484FDEA248F5") == 22 + + +def test_capability(): + assert allcall.capability("5D484FDEA248F5")[0] == 5 diff --git a/tests/test_surv.py b/tests/test_surv.py new file mode 100644 index 0000000..0286e27 --- /dev/null +++ b/tests/test_surv.py @@ -0,0 +1,22 @@ +from pyModeS import surv + + +def test_fs(): + assert surv.fs("2A00516D492B80")[0] == 2 + + +def test_dr(): + assert surv.dr("2A00516D492B80")[0] == 0 + + +def test_um(): + assert surv.um("200CBE4ED80137")[0] == 9 + assert surv.um("200CBE4ED80137")[1] == 1 + + +def test_identity(): + assert surv.identity("2A00516D492B80") == "0356" + + +def test_altitude(): + assert surv.altitude("20001718029FCD") == 36000