File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -126,11 +126,6 @@ def test_write_not_fail(write_fail_mock):
126126 ('gnutar' , 'a_string' .encode ()),
127127 ('pax' , json .dumps ({'a' : 1 , 'b' : 2 , 'c' : 3 }).encode ())])
128128def test_adding_entry_from_memory (archfmt , data_bytes ):
129- if sys .version_info [0 ] < 3 :
130- string_types = (str , unicode ) # noqa: F821
131- else :
132- string_types = (str ,)
133-
134129 entry_path = 'testfile.data'
135130
136131 # entry_data must be a list of byte-like objects for maximum compatibility
@@ -152,11 +147,7 @@ def write_callback(data):
152147 buf = b'' .join (blocks )
153148 with libarchive .memory_reader (buf ) as memory_archive :
154149 for archive_entry in memory_archive :
155- expected = b'' .join (
156- [a .encode ()
157- if isinstance (a , string_types )
158- else a for a in entry_data ],
159- )
150+ expected = b'' .join (entry_data )
160151 actual = b'' .join (
161152 archive_entry .get_blocks (),
162153 )
You can’t perform that action at this time.
0 commit comments