summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-06-12 10:06:30 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-06-12 10:06:30 +0200
commit1cc440e8426cdd297f73f7322356744d190f58fe (patch)
treed5b2d44015601885491a322a437d72e64adf4768 /tests
parent02f1443ee316fe5c0dcf1c56471168b5482c49df (diff)
downloadpython-apt-1cc440e8426cdd297f73f7322356744d190f58fe.tar.gz
tests/test_utils.py: fix absolute path in the test
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index dc54c1ba..2676bb98 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -6,11 +6,13 @@
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
+import datetime
+import os
import sys
+import unittest
+
import apt_pkg
import apt.utils
-import datetime
-import unittest
from apt.utils import (
get_maintenance_end_date,
@@ -20,7 +22,9 @@ from apt.utils import (
class TestUtils(unittest.TestCase):
def test_get_release_date_from_release_file(self):
- t = get_release_date_from_release_file("./tests/data/misc/foo_Release")
+ path = os.path.join(os.path.dirname(__file__),
+ "data", "misc", "foo_Release")
+ t = get_release_date_from_release_file(path)
self.assertEqual(str(datetime.datetime.utcfromtimestamp(t)),
"2012-04-25 22:49:23")