Skip to content

Commit

Permalink
Fix assertion and minor styles for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NyanHelsing authored and cslzchen committed May 29, 2018
1 parent e2d1c50 commit 0d24d2a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 22 deletions.
7 changes: 2 additions & 5 deletions tests/providers/box/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,11 +880,8 @@ def test_will_self_overwrite(self, provider, other_provider):
dest_path = WaterButlerPath('/50 shades of nope2223.txt',
_ids=(provider.folder, '2342sdfsd'))

result = provider.will_self_overwrite(other_provider, src_path, dest_path)
assert result is False

result = provider.will_self_overwrite(other_provider, src_path, src_path)
assert result is True
assert provider.will_self_overwrite(other_provider, src_path, dest_path) is False
assert provider.will_self_overwrite(other_provider, src_path, src_path) is True

def test_can_duplicate_names(self, provider):
assert provider.can_duplicate_names() is False
Expand Down
7 changes: 2 additions & 5 deletions tests/providers/dropbox/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,11 +931,8 @@ def test_will_self_overwrite(self, provider, other_provider):
dest_path = WaterButlerPath('/50 shades of nope2223.txt',
_ids=(provider.folder, '2342sdfsd'))

result = provider.will_self_overwrite(other_provider, src_path, dest_path)
assert result is False

result = provider.will_self_overwrite(other_provider, src_path, src_path)
assert result is True
assert provider.will_self_overwrite(other_provider, src_path, dest_path) is False
assert provider.will_self_overwrite(other_provider, src_path, src_path) is True

def test_can_intra_copy(self, provider):
assert provider.can_intra_copy(provider)
Expand Down
7 changes: 2 additions & 5 deletions tests/providers/googledrive/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -1608,11 +1608,8 @@ def test_will_self_overwrite(self, provider, other_provider):
src_path = GoogleDrivePath('/root/Gear1.stl', _ids=['0', '10', '11'])
dest_path = GoogleDrivePath('/root/Gear23123.stl', _ids=['0', '10', '12'])

result = provider.will_self_overwrite(other_provider, src_path, dest_path)
assert result is False

result = provider.will_self_overwrite(other_provider, src_path, src_path)
assert result is True
assert provider.will_self_overwrite(other_provider, src_path, dest_path) is False
assert provider.will_self_overwrite(other_provider, src_path, src_path) is True

def test_can_duplicate_names(self, provider):
assert provider.can_duplicate_names() is True
Expand Down
7 changes: 2 additions & 5 deletions tests/providers/owncloud/test_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,8 @@ def test_will_self_overwrite(self, provider):
dest_path = WaterButlerPath('/50 shades of nope2223.txt',
_ids=(provider.folder, '2342sdfsd'))

result = provider.will_self_overwrite(provider, src_path, dest_path)
assert result is False

result = provider.will_self_overwrite(provider, src_path, src_path)
assert result is True
assert provider.will_self_overwrite(provider, src_path, dest_path) is False
assert provider.will_self_overwrite(provider, src_path, src_path) is True

def test_can_intra_copy(self, provider, provider_different_credentials):
assert provider.can_intra_copy(provider)
Expand Down
4 changes: 2 additions & 2 deletions waterbutler/core/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ def will_self_overwrite(self,
dest_provider: 'BaseProvider',
src_path: wb_path.WaterButlerPath,
dest_path: wb_path.WaterButlerPath) -> bool:
""" Return wether a move or copy operation will result in a self-overwrite.
"""Return wether a move or copy operation will result in a self-overwrite.
.. note::
.. note::
Defaults to False
Overridden by providers that need to run this check
Expand Down

0 comments on commit 0d24d2a

Please sign in to comment.