]> git.ipfire.org Git - pakfire.git/blobdiff - tests/python/keys.py
tests: Add functions to make opening files in the test env easier
[pakfire.git] / tests / python / keys.py
index 0c84ac0edcfcb956fbbce5ffeca402ff0f687823..9663776e91c42c470ff225a93bd4c47103f006f4 100755 (executable)
@@ -19,7 +19,6 @@
 #                                                                             #
 ###############################################################################
 
-import os
 import pakfire
 
 import tests
@@ -48,11 +47,7 @@ class KeysTests(tests.TestCase):
                self.assertEqual(key.algorithm, "Ed255919")
 
        def _import(self, path):
-               path = os.path.join(
-                       os.environ.get("TEST_DATA_DIR"), path,
-               )
-
-               with open(path, "rb") as f:
+               with self.open(path) as f:
                        payload = f.read()
 
                return self.pakfire.import_key(payload)