From: Michael Tremer Date: Thu, 20 Oct 2022 13:35:55 +0000 (+0000) Subject: tests: Drop the test database and use the distributed one X-Git-Tag: 0.9.16~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b3db7b12cfead1adeb8ef95d70a68e0664bbd11;p=location%2Flibloc.git tests: Drop the test database and use the distributed one Fixes: #12958 Signed-off-by: Michael Tremer --- diff --git a/Makefile.am b/Makefile.am index 60dab7d..8de0edf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -331,16 +331,12 @@ TESTS_LDADD = \ TESTS_ENVIRONMENT = \ PYTHONPATH=$(abs_srcdir)/src/python:$(abs_builddir)/src/python/.libs \ - TEST_DATA_DIR="$(abs_top_srcdir)/tests/data" + TEST_DATA_DIR="$(abs_top_srcdir)/data" TESTS = \ $(check_PROGRAMS) \ $(dist_check_SCRIPTS) -EXTRA_DIST += \ - tests/data/location-2022-03-30.db \ - tests/data/signing-key.pem - CLEANFILES += \ testdata.db diff --git a/src/test-signature.c b/src/test-signature.c index 9af9236..e1be5b1 100644 --- a/src/test-signature.c +++ b/src/test-signature.c @@ -94,7 +94,7 @@ int main(int argc, char** argv) { } // Open another public key - public_key = freopen(ABS_SRCDIR "/src/signing-key.pem", "r", public_key); + public_key = freopen(ABS_SRCDIR "/data/signing-key.pem", "r", public_key); if (!public_key) { fprintf(stderr, "Could not open public key file: %m\n"); exit(EXIT_FAILURE); diff --git a/tests/data/location-2022-03-30.db b/tests/data/location-2022-03-30.db deleted file mode 100644 index fff8d34..0000000 Binary files a/tests/data/location-2022-03-30.db and /dev/null differ diff --git a/tests/data/signing-key.pem b/tests/data/signing-key.pem deleted file mode 120000 index b1da823..0000000 --- a/tests/data/signing-key.pem +++ /dev/null @@ -1 +0,0 @@ -../../src/signing-key.pem \ No newline at end of file diff --git a/tests/python/test-database.py b/tests/python/test-database.py index 4846e7a..1c3448b 100755 --- a/tests/python/test-database.py +++ b/tests/python/test-database.py @@ -25,7 +25,7 @@ TEST_DATA_DIR = os.environ["TEST_DATA_DIR"] class Test(unittest.TestCase): def setUp(self): - path = os.path.join(TEST_DATA_DIR, "location-2022-03-30.db") + path = os.path.join(TEST_DATA_DIR, "database.db") # Load the database self.db = location.Database(path) @@ -45,7 +45,7 @@ class Test(unittest.TestCase): self.assertEqual(self.db.license, "CC BY-SA 4.0") # Created At - self.assertEqual(self.db.created_at, 1648619023) + self.assertIsInstance(self.db.created_at, int) def test_fetch_network(self): """ diff --git a/tests/python/test-export.py b/tests/python/test-export.py index 419b105..6921861 100755 --- a/tests/python/test-export.py +++ b/tests/python/test-export.py @@ -25,7 +25,7 @@ TEST_DATA_DIR = os.environ["TEST_DATA_DIR"] class Test(unittest.TestCase): def setUp(self): - path = os.path.join(TEST_DATA_DIR, "location-2022-03-30.db") + path = os.path.join(TEST_DATA_DIR, "database.db") # Load the database self.db = location.Database(path)