X-Git-Url: http://www.average.org/gitweb/?a=blobdiff_plain;f=test%2Ftest_ocid_dload.py;fp=test%2Ftest_ocid_dload.py;h=0089ce01ba987b591be57eff3d6bec209eb15aa2;hb=539601a0c1494218d57559a058d2fd7df6ab69c2;hp=0000000000000000000000000000000000000000;hpb=099a8195d469486fa9347cc5faaadd3614a2a445;p=loctrkd.git diff --git a/test/test_ocid_dload.py b/test/test_ocid_dload.py new file mode 100644 index 0000000..0089ce0 --- /dev/null +++ b/test/test_ocid_dload.py @@ -0,0 +1,27 @@ +""" Send junk to the collector """ + +from sqlite3 import connect +from time import sleep +from typing import Any +import unittest +from .common import send_and_drain, TestWithServers +from gps303 import ocid_dload + + +class Ocid_Dload(TestWithServers): + def setUp(self, *args: str, **kwargs: Any) -> None: + super().setUp(httpd=True) + + def tearDown(self) -> None: + sleep(1) # give collector some time + super().tearDown() + + def test_ocid_dload(self) -> None: + ocid_dload.main(self.conf) + with connect(self.conf.get("opencellid", "dbfn")) as db: + (count,) = db.execute("select count(*) from cells").fetchone() + self.assertEqual(count, 163) + + +if __name__ == "__main__": + unittest.main()