-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tests, and fix discovered bugs #68
Merged
Merged
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
33b0be2
Check that 'seek' method of 'openbin' objects returns the new position
1cb9bdb
Check that FS.copy and FS.copydir raise the right errors
509a780
Check that FS.move and FS.movedir raise the right errors
7a17ad3
Add tests for filesystems supporting unicode paths
1ce5c3e
Add tests to check case sensitivity
0e678ff
Fix `FTPFile` methods that didn't return a proper value
bcfbabf
Make `FS.move` raise `FileExpected` is the src_path is a folder
84700ac
Fix `FTPFile.truncate` not returning the new size
341085e
Fix `MemoryFile.truncate` and `MemoryFile.write` not returning anything
06a2411
Fix `MemoryFile.truncate` moving the cursor when given a size
8acd0d6
Fix `FS.copydir` not raising `DirectoryExpected` and `ResourceNotFound`
085c8a1
Check that FTP server supports UTF-8 before connecting to it for real
d6b4b3f
Check that syspath works fine with an UTF-8 filename
3ee3fc1
Rewrite TestFTPFS to use pyftpdlib.test.FTPd
1a36612
Fix ftpfs._encode not using utf-8 in Python 2.7
46003ff
Bump required pyftpdlib to 1.5.2
e738c3c
Make FTPFS properly encode/decode the FTP server response
72a0e6e
Fix nose mistaking ThreadedTestFTPd for a TestCase
8d3b88f
Make sure ftpfs._encode/_decode use the proper encoding
a9074bc
Remove potential bug in FTPFile.truncate
43e341b
Remove binary_type import from six
2f36daa
Add server encoding detection inside of `FTPFS.ftp`
5ed51f8
Use 'replace' error handling to decode server in `FTPFS`
357f334
Remove `FTPFile.__lenght_hint__`
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -318,6 +318,8 @@ def copydir(self, src_path, dst_path, create=False): | |
with self._lock: | ||
if not create and not self.exists(dst_path): | ||
raise errors.ResourceNotFound(dst_path) | ||
if not self.getinfo(src_path).is_dir: | ||
raise errors.DirectoryExpected(src_path) | ||
copy.copy_dir( | ||
self, | ||
src_path, | ||
|
@@ -820,6 +822,8 @@ def move(self, | |
|
||
if not overwrite and self.exists(dst_path): | ||
raise errors.DestinationExists(dst_path) | ||
if self.getinfo(src_path).is_dir: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ditto here... |
||
raise errors.FileExpected(src_path) | ||
if self.getmeta().get('supports_rename', False): | ||
try: | ||
src_sys_path = self.getsyspath(src_path) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would
isdir
not be better? If you don't need the info object, then the FS object can use a potentially faster codepath.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling
getinfo
will raise aResourceNotFound
as expected, whereas if you were to useisdir
you would need one call to check for the existence of a resource, and a second call to check that the resource is a directory.Since the base implementation uses
getinfo
as a base forisdir
,isfile
andexist
, it will result in only one call togetinfo
to do as such but two calls otherwise.