File: fix-tests-failing-with-libarchive-3.2.patch

package info (click to toggle)
python-libarchive-c 2.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 836 kB
  • ctags: 210
  • sloc: python: 808; makefile: 26; sh: 8
file content (57 lines) | stat: -rw-r--r-- 1,600 bytes parent folder | download | duplicates (2)
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
From: Changaco <changaco@changaco.oy.lc>
Subject: fix broken test by ignoring permissions
Bug: https://github.com/Changaco/python-libarchive-c/issues/34
Bug-Debian: https://bugs.debian.org/829022
Origin: upstream, commit:185d44e6cb626154e8365be7d7c27f5b9cbcf16a

--- a/tests/data/unicode2.zip.json
+++ b/tests/data/unicode2.zip.json
@@ -10,7 +10,7 @@
     "isblk": false, 
     "isreg": false, 
     "isfifo": false, 
-    "mode": "rwxrwxrwx", 
+    "mode": null, 
     "islnk": false, 
     "ischr": false
   }, 
@@ -25,8 +25,8 @@
     "isblk": false, 
     "isreg": true, 
     "isfifo": false, 
-    "mode": "rw-rw-rw-", 
+    "mode": null, 
     "islnk": false, 
     "ischr": false
   }
-]
\ No newline at end of file
+]
--- a/tests/test_entry.py
+++ b/tests/test_entry.py
@@ -72,14 +72,15 @@
 
 
 def test_check_archiveentry_with_unicode_and_binary_entries_zip2():
-    check_entries(join(data_dir, 'unicode2.zip'))
+    check_entries(join(data_dir, 'unicode2.zip'), ignore='mode')
 
 
 def test_check_archiveentry_with_unicode_entries_and_name_zip():
     check_entries(join(data_dir, '\ud504\ub85c\uadf8\ub7a8.zip'))
 
 
-def check_entries(test_file, regen=False):
+def check_entries(test_file, regen=False, ignore=''):
+    ignore = ignore.split()
     fixture_file = test_file + '.json'
     if regen:
         entries = list(get_entries(test_file))
@@ -89,4 +90,7 @@
         expected = json.load(ex)
     actual = list(get_entries(test_file))
     for e1, e2 in zip(actual, expected):
+        for key in ignore:
+            e1.pop(key)
+            e2.pop(key)
         assert e1 == e2