Skip to content

Commit

Permalink
add basic test for mode and strmode properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Changaco committed Feb 6, 2015
1 parent a6e34c1 commit 5c81dfa
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_entry.py
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

0 comments on commit 5c81dfa

Please sign in to comment.