1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
|
Description: Use relative imports to make test suite work with DEP-8 tests
Author: Sebastian Ramacher <sramacher@debian.org>
Last-Update: 204-07-03
--- python-libdiscid-0.4.1.orig/libdiscid/tests/test_compat_discid.py
+++ python-libdiscid-0.4.1/libdiscid/tests/test_compat_discid.py
@@ -30,6 +30,7 @@ except ImportError:
import libdiscid
from libdiscid.compat import discid
from libdiscid.compat.discid import DiscError, TOCError
+from .common import PutSuccess, PutFail1, PutFail2, PutFail3, PutFail2_2, PutFail3_2
# as long as Python 3.2 is supported, hack around the missing u
try:
@@ -81,7 +82,7 @@ class TestCompatDiscID(unittest.TestCase
self.assertRaises(DiscError, discid.read, b'/does/not/exist')
def test_put(self):
- testdata = libdiscid.tests.common.PutSuccess
+ testdata = PutSuccess
disc = discid.put(testdata.first, testdata.last, testdata.sectors,
testdata.offsets)
@@ -111,29 +112,29 @@ class TestCompatDiscID(unittest.TestCase
def test_put_fail_1(self):
# !(first < last)
- testdata = libdiscid.tests.common.PutFail1
+ testdata = PutFail1
self.assertRaises(TOCError, discid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
def test_put_fail_2(self):
# !(first >= 1)
- testdata = libdiscid.tests.common.PutFail2
+ testdata = PutFail2
self.assertRaises(TOCError, discid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
# !(first < 100)
- testdata = libdiscid.tests.common.PutFail2_2
+ testdata = PutFail2_2
self.assertRaises(TOCError, discid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
def test_put_fail_3(self):
# !(last >= 1)
- testdata = libdiscid.tests.common.PutFail3
+ testdata = PutFail3
self.assertRaises(TOCError, discid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
# !(last < 100)
- testdata = libdiscid.tests.common.PutFail3_2
+ testdata = PutFail3_2
self.assertRaises(TOCError, discid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
--- python-libdiscid-0.4.1.orig/libdiscid/tests/test_libdiscid.py
+++ python-libdiscid-0.4.1/libdiscid/tests/test_libdiscid.py
@@ -28,8 +28,8 @@ try:
except ImportError:
import unittest
import libdiscid
-import libdiscid.tests.common
from libdiscid import DiscError
+from .common import PutSuccess, PutFail1, PutFail2, PutFail3, PutFail2_2, PutFail3_2
# as long as Python 3.2 is supported, hack around the missing u
try:
@@ -72,7 +72,7 @@ class TestLibDiscId(unittest.TestCase):
self.assertRaises(NotImplementedError, libdiscid.read)
def test_put(self):
- testdata = libdiscid.tests.common.PutSuccess
+ testdata = PutSuccess
disc = libdiscid.put(testdata.first, testdata.last, testdata.sectors,
testdata.offsets)
@@ -106,29 +106,29 @@ class TestLibDiscId(unittest.TestCase):
def test_put_fail_1(self):
# !(first < last)
- testdata = libdiscid.tests.common.PutFail1
+ testdata = PutFail1
self.assertRaises(DiscError, libdiscid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
def test_put_fail_2(self):
# !(first >= 1)
- testdata = libdiscid.tests.common.PutFail2
+ testdata = PutFail2
self.assertRaises(DiscError, libdiscid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
# !(first < 100)
- testdata = libdiscid.tests.common.PutFail2_2
+ testdata = PutFail2_2
self.assertRaises(DiscError, libdiscid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
def test_put_fail_3(self):
# !(last >= 1)
- testdata = libdiscid.tests.common.PutFail3
+ testdata = PutFail3
self.assertRaises(DiscError, libdiscid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
# !(last < 100)
- testdata = libdiscid.tests.common.PutFail3_2
+ testdata = PutFail3_2
self.assertRaises(DiscError, libdiscid.put, testdata.first, testdata.last,
testdata.sectors, testdata.offsets)
|