]> git.ipfire.org Git - location/libloc.git/commitdiff
tests: Drop the test database and use the distributed one
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Oct 2022 13:35:55 +0000 (13:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 20 Oct 2022 14:32:13 +0000 (14:32 +0000)
Fixes: #12958
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Makefile.am
src/test-signature.c
tests/data/location-2022-03-30.db [deleted file]
tests/data/signing-key.pem [deleted symlink]
tests/python/test-database.py
tests/python/test-export.py

index 60dab7d5eedba631649f52183a440bfc9e8d6346..8de0edf7ce6c0b737530fef1bf7658b213160f4e 100644 (file)
@@ -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
 
index 9af9236b86a7b54a8fd1eac75896db2948e2fc4e..e1be5b1889122d6b4ff9f2ad51eeb135307aaeb5 100644 (file)
@@ -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 (file)
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 (symlink)
index b1da823..0000000
+++ /dev/null
@@ -1 +0,0 @@
-../../src/signing-key.pem
\ No newline at end of file
index 4846e7a2df6eea2c70f975897de95b7ac3d9073a..1c3448bd2d970e328d542cb036199ee209b0165d 100755 (executable)
@@ -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):
                """
index 419b10500ab95db3eaee168bce1131257cc6162c..69218612928a376f5da136d741acdec44237b2a4 100755 (executable)
@@ -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)