Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions tests/providers/osfstorage/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,6 @@ async def test_intra_move_reject_by_quota(self, provider_one, auth, credentials,

class TestCrossRegionCopy:

@pytest.mark.skip('TODO: skipping to enable deploy')
@pytest.mark.asyncio
@pytest.mark.aiohttpretty
async def test_copy_file(self, provider_one, provider_two, file_stream, upload_response):
Expand All @@ -1105,11 +1104,14 @@ async def test_copy_file(self, provider_one, provider_two, file_stream, upload_r
dest_path = WaterButlerPath('/', _ids=('Test',))

quota_url, quota_params = build_signed_url_without_auth(dst_provider, 'GET', 'quota_status')
print('********** Registerting quota url **********')
print('quota_url:', quota_url)
print('quota_params:', quota_params)
aiohttpretty.register_json_uri('GET', quota_url, params=quota_params, status=200,
body={'over_quota': False})

metadata, created = await src_provider.copy(dst_provider, src_path, dest_path,
handle_naming=False);
handle_naming=False, test_debug=True);

assert metadata is not None
assert created is True
Expand Down
11 changes: 10 additions & 1 deletion waterbutler/providers/osfstorage/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,8 @@ async def copy(self,
dest_path: WaterButlerPath,
rename: str = None,
conflict: str = 'replace',
handle_naming: bool = True) -> tuple[BaseMetadata, bool]:
handle_naming: bool = True,
test_debug: bool = False) -> tuple[BaseMetadata, bool]: # TODO: MAKE SURE TO REMOVE THIS LATER
"""Override parent's copy to support cross-region osfstorage copies. Delegates to
:meth:`.BaseProvider.copy` when destination is not osfstorage. If both providers are in the
same region (i.e. `.can_intra_copy` is true), call `.intra_copy`. Otherwise, grab a
Expand All @@ -450,6 +451,14 @@ async def copy(self,
This is needed because a same-region osfstorage copy will duplicate *all* the versions of
the file, but `.BaseProvider.copy` will only copy the most recent version.
"""
if test_debug:
print('**********OSFStorageProvider.copy called with:**********')
print('dest_provider:', dest_provider.NAME)
print('src_path:', src_path)
print('dest_path:', dest_path)
print('rename:', rename)
print('conflict:', conflict)
print('handle_naming:', handle_naming)

# when moving to non-osfstorage, default move is fine
if dest_provider.NAME != 'osfstorage':
Expand Down