~ubuntu-branches/ubuntu/trusty/python-libdiscid/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/patches/skip-read-tests-if-not-available.patch

  • Committer: Package Import Robot
  • Author(s): Sebastian Ramacher
  • Date: 2013-10-03 17:32:00 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20131003173200-1p3qlyl3aj14y81k
Tags: 0.4-1
* New upstream version.
* debian/patches:
  - skip-read-tests-if-not-available.patch: Removed, no longer needed.
  - sphinx-documentation.patch: Refreshed.
* debian/control: Bump libdiscid0-dev to >= 0.6 for new features.
* debian/{rules,python-libdiscid-doc.docs}: Update for new path of the
  documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Description: Skip read tests if read is not supported
2
 
Origin: upstream,
3
 
 https://github.com/sebastinas/python-libdiscid/commit/11a0cee9
4
 
Last-Update: 2013-09-09
5
 
 
6
 
diff --git a/libdiscid/tests/test_compat_discid.py b/libdiscid/tests/test_compat_discid.py
7
 
index 60e85bd..f668ac7 100644
8
 
--- a/libdiscid/tests/test_compat_discid.py
9
 
+++ b/libdiscid/tests/test_compat_discid.py
10
 
@@ -24,13 +24,14 @@
11
 
 """
12
 
 
13
 
 try:
14
 
-  from unittest2 import TestCase, main
15
 
+  import unittest2 as unittest
16
 
 except ImportError:
17
 
-  from unittest import TestCase, main
18
 
+  import unittest
19
 
+import libdiscid
20
 
 from libdiscid.compat import discid
21
 
 from libdiscid.compat.discid import DiscError, TOCError
22
 
 
23
 
-class TestCompatDiscID(TestCase):
24
 
+class TestCompatDiscID(unittest.TestCase):
25
 
   def test_default_device(self):
26
 
     self.assertIsNotNone(discid.get_default_device())
27
 
 
28
 
@@ -51,12 +52,18 @@ def test_empty_is_none(self):
29
 
     self.assertIsNone(disc.seconds)
30
 
     self.assertEqual(len(disc.tracks), 0)
31
 
 
32
 
+  @unittest.skipIf(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in
33
 
+                   libdiscid.FEATURES, "not available on this platform")
34
 
   def test_read_fail(self):
35
 
     self.assertRaises(DiscError, discid.read, u'/does/not/exist')
36
 
 
37
 
+  @unittest.skipIf(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in
38
 
+                   libdiscid.FEATURES, "not available on this platform")
39
 
   def test_encoded_device(self):
40
 
     self.assertRaises(DiscError, discid.read, '/does/not/exist')
41
 
 
42
 
+  @unittest.skipIf(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in
43
 
+                   libdiscid.FEATURES, "not available on this platform")
44
 
   def test_byte_device(self):
45
 
     self.assertRaises(DiscError, discid.read, b'/does/not/exist')
46
 
 
47
 
@@ -131,4 +138,4 @@ def test_put_fail_3(self):
48
 
 
49
 
 
50
 
 if __name__ == '__main__':
51
 
-  main()
52
 
+  unittest.main()
53
 
diff --git a/libdiscid/tests/test_libdiscid.py b/libdiscid/tests/test_libdiscid.py
54
 
index b0cf9d3..e138f62 100644
55
 
--- a/libdiscid/tests/test_libdiscid.py
56
 
+++ b/libdiscid/tests/test_libdiscid.py
57
 
@@ -24,13 +24,13 @@
58
 
 """
59
 
 
60
 
 try:
61
 
-  from unittest2 import TestCase, main
62
 
+  import unittest2 as unittest
63
 
 except ImportError:
64
 
-  from unittest import TestCase, main
65
 
+  import unittest
66
 
 import libdiscid
67
 
 from libdiscid import DiscError
68
 
 
69
 
-class TestLibDiscId(TestCase):
70
 
+class TestLibDiscId(unittest.TestCase):
71
 
   def test_version(self):
72
 
     self.assertIsNotNone(libdiscid.__version__)
73
 
     self.assertIsNotNone(libdiscid.__discid_version__)
74
 
@@ -48,6 +48,8 @@ def test_features(self):
75
 
     self.assertIsNotNone(libdiscid.FEATURE_ISRC)
76
 
     self.assertIsNotNone(libdiscid.FEATURES_MAPPING)
77
 
 
78
 
+  @unittest.skipIf(libdiscid.FEATURES_MAPPING[libdiscid.FEATURE_READ] not in
79
 
+                   libdiscid.FEATURES, "not available on this platform")
80
 
   def test_read_fail(self):
81
 
     self.assertRaises(DiscError, libdiscid.read, u'/does/not/exist')
82
 
 
83
 
@@ -123,4 +125,4 @@ def test_put_fail_3(self):
84
 
 
85
 
 
86
 
 if __name__ == '__main__':
87
 
-  main()
88
 
+  unittest.main()
89