Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AddisonSchiller committed Nov 22, 2017
1 parent 80beea1 commit ab8a66e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
18 changes: 18 additions & 0 deletions tests/core/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,15 @@ async def test_passes_on_rename(self, provider1):
conflict='replace',
)

@pytest.mark.asyncio
async def test_copy_will_self_overwrite(self, provider1):
src_path = await provider1.validate_path('/source/path')
dest_path = await provider1.validate_path('/destination/')
provider1.will_self_overwrite = utils.MockCoroutine()

with pytest.raises(exceptions.OverwriteSelfError):
await provider1.copy(provider1, src_path, dest_path)

@pytest.mark.asyncio
async def test_checks_can_intra_copy(self, provider1):
provider1.can_intra_copy = mock.Mock(return_value=False)
Expand Down Expand Up @@ -393,6 +402,15 @@ async def test_passes_on_rename(self, provider1):
conflict='replace',
)

@pytest.mark.asyncio
async def test_move_will_self_overwrite(self, provider1):
src_path = await provider1.validate_path('/source/path')
dest_path = await provider1.validate_path('/destination/')
provider1.will_self_overwrite = utils.MockCoroutine()

with pytest.raises(exceptions.OverwriteSelfError):
await provider1.move(provider1, src_path, dest_path)

@pytest.mark.asyncio
async def test_checks_can_intra_move(self, provider1):
provider1.can_intra_move = mock.Mock(return_value=False)
Expand Down
1 change: 0 additions & 1 deletion tests/providers/owncloud/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ def test_will_self_overwrite(self, provider):
result = provider.will_self_overwrite(provider, src_path, src_path)
assert result is True


def test_can_intra_copy(self, provider, provider_different_credentials):
assert provider.can_intra_copy(provider)
assert not provider.can_intra_copy(provider_different_credentials)
Expand Down

0 comments on commit ab8a66e

Please sign in to comment.