Skip to content

Commit

Permalink
Merge pull request #35 from Changaco/fix-broken-test
Browse files Browse the repository at this point in the history
Fix test broken by libarchive 3.2
  • Loading branch information
Changaco authored Jul 23, 2016
2 parents edc5be4 + 185d44e commit fff4590
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/data/unicode2.zip.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"isblk": false,
"isreg": false,
"isfifo": false,
"mode": "rwxrwxrwx",
"mode": null,
"islnk": false,
"ischr": false
},
Expand All @@ -25,8 +25,8 @@
"isblk": false,
"isreg": true,
"isfifo": false,
"mode": "rw-rw-rw-",
"mode": null,
"islnk": false,
"ischr": false
}
]
]
8 changes: 6 additions & 2 deletions tests/test_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,15 @@ def test_check_archiveentry_with_unicode_and_binary_entries_zip():


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))
Expand All @@ -85,4 +86,7 @@ def check_entries(test_file, regen=False):
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

0 comments on commit fff4590

Please sign in to comment.