-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add basic test for
mode
and strmode
properties
- Loading branch information
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# This file is part of a program licensed under the terms of the GNU Lesser | ||
# General Public License version 2 (or at your option any later version) | ||
# as published by the Free Software Foundation: http://www.gnu.org/licenses/ | ||
|
||
|
||
from __future__ import division, print_function, unicode_literals | ||
|
||
from os import stat | ||
|
||
from libarchive import memory_reader, memory_writer | ||
|
||
|
||
def test_entry_properties(): | ||
|
||
buf = bytes(bytearray(1000000)) | ||
with memory_writer(buf, 'gnutar') as archive: | ||
archive.add_files('README.rst') | ||
|
||
with memory_reader(buf) as archive: | ||
for entry in archive: | ||
assert entry.mode == stat('README.rst')[0] | ||
assert b'rw' in entry.strmode |