mirror of
https://github.com/onionshare/onionshare.git
synced 2025-05-04 07:25:10 -04:00
Move ZipWriter from common into web, because that's the only place it's used
This commit is contained in:
parent
2e31db8543
commit
2e6538b7f8
5 changed files with 143 additions and 111 deletions
|
@ -8,7 +8,7 @@ import tempfile
|
|||
|
||||
import pytest
|
||||
|
||||
from onionshare import common
|
||||
from onionshare import common, web
|
||||
|
||||
@pytest.fixture
|
||||
def temp_dir_1024():
|
||||
|
@ -64,7 +64,7 @@ def temp_file_1024_delete():
|
|||
# pytest > 2.9 only needs @pytest.fixture
|
||||
@pytest.yield_fixture(scope='session')
|
||||
def custom_zw():
|
||||
zw = common.ZipWriter(
|
||||
zw = web.ZipWriter(
|
||||
zip_filename=common.random_string(4, 6),
|
||||
processed_size_callback=lambda _: 'custom_callback'
|
||||
)
|
||||
|
@ -76,7 +76,7 @@ def custom_zw():
|
|||
# pytest > 2.9 only needs @pytest.fixture
|
||||
@pytest.yield_fixture(scope='session')
|
||||
def default_zw():
|
||||
zw = common.ZipWriter()
|
||||
zw = web.ZipWriter()
|
||||
yield zw
|
||||
zw.close()
|
||||
tmp_dir = os.path.dirname(zw.zip_filename)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue