|
13 | 13 | import tempfile
|
14 | 14 | import shutil
|
15 | 15 | from contextlib import contextmanager
|
16 |
| -from multicorn.compat import unicode_ |
| 16 | +from multicorn.compat import unicode_, bytes_ |
17 | 17 | import pytest
|
18 | 18 |
|
19 | 19 | from .structuredfs import StructuredDirectory, Item
|
@@ -84,8 +84,6 @@ def test_parser(tempdir):
|
84 | 84 | bin = make('{category}/{{num}}_{name}.bin')
|
85 | 85 | assert bin.properties == set(['category', 'name'])
|
86 | 86 | assert bin._path_parts_properties == (('category',), ('name',))
|
87 |
| - assert [regex.pattern for regex in bin._path_parts_re] \ |
88 |
| - == ['^(?P<category>.*)$', r'^\{num\}\_(?P<name>.*)\.bin$'] |
89 | 87 |
|
90 | 88 |
|
91 | 89 | @with_tempdir
|
@@ -160,11 +158,11 @@ def test_items(tempdir):
|
160 | 158 | key=lambda item: item['num'])
|
161 | 159 | assert len(item_foo) == 3
|
162 | 160 | assert dict(item_foo) == dict(category='lipsum', num='4', name='foo')
|
163 |
| - assert item_foo.read() == '' |
| 161 | + assert item_foo.read() == bytes_('') |
164 | 162 |
|
165 | 163 | assert len(item_bar) == 3
|
166 | 164 | assert dict(item_bar) == dict(category='lipsum', num='5', name='bar')
|
167 |
| - assert item_bar.read() == 'BAR' |
| 165 | + assert item_bar.read() == bytes_('BAR') |
168 | 166 |
|
169 | 167 | content = b'Hello,\xc2\xa0W\xc3\xb6rld!'.decode('utf-8')
|
170 | 168 | item_foo.content = content
|
|
0 commit comments