]> www.average.org Git - loctrkd.git/blob - test/test_ocid_dload.py
sysnits & config: update name, remove unneeded bit
[loctrkd.git] / test / test_ocid_dload.py
1 """ Send junk to the collector """
2
3 from sqlite3 import connect
4 from time import sleep
5 from typing import Any
6 import unittest
7 from .common import send_and_drain, TestWithServers
8 from loctrkd import ocid_dload
9
10
11 class Ocid_Dload(TestWithServers):
12     def setUp(self, *args: str, **kwargs: Any) -> None:
13         super().setUp(httpd=True)
14
15     def tearDown(self) -> None:
16         sleep(1)  # give collector some time
17         super().tearDown()
18
19     def test_ocid_dload(self) -> None:
20         ocid_dload.main(self.conf)
21         with connect(self.conf.get("opencellid", "dbfn")) as db:
22             (count,) = db.execute("select count(*) from cells").fetchone()
23         self.assertEqual(count, 163)
24
25
26 if __name__ == "__main__":
27     unittest.main()