Commit 9b3db7b1 authored by Michael Tremer's avatar Michael Tremer

tests: Drop the test database and use the distributed one

Fixes: #12958
Signed-off-by: default avatarMichael Tremer <michael.tremer@ipfire.org>
parent 2f70e129
......@@ -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
......
......@@ -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);
......
../../src/signing-key.pem
\ No newline at end of file
......@@ -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):
"""
......
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment