Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 27, 2016
1 parent bc25f3e commit c08f259
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
10 changes: 8 additions & 2 deletions docs/source/implementers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ To create a PyFilesystem interface, derive a class from :class:`fs.base.FS` and

Take care to copy the method signatures *exactly*, including default values. It is also essential that you follow the same logic with regards to exceptions, and only raise exceptions in :mod:`fs.errors`.

Constructor
-----------

There are no particular requirements regarding how a PyFilesystem class is constructed, but be sure to call the base class ``__init__`` method with no parameters.


Testing Filesystems
-------------------

Expand Down Expand Up @@ -39,9 +45,9 @@ The following methods MAY be implemented in a PyFilesystem interface.

These methods have a default implementation, but may be overridden if you can supply a more optimal version. For instance the ``getbytes`` method opens a file and reads the contents in chunks. If you are able to write a version which retrieves the file data without opening a file, it *may* be faster.

Exactly which methods you implement depends on how and where the data is stored. For network filesystems, a good candidate to implement, is the ``scandir`` methods which would otherwise call a combination of ``listdir`` and ``getinfo`` for each file.
Exactly which methods you should implement depends on how and where the data is stored. For network filesystems, a good candidate to implement, is the ``scandir`` methods which would otherwise call a combination of ``listdir`` and ``getinfo`` for each file.

In the general case, it is a good idea to look at how these methods are implemented in :class:`fs.base.FS`. Only implement the methods where you have a more efficient implementation.
In the general case, it is a good idea to look at how these methods are implemented in :class:`fs.base.FS`, and only write a custom version if it would be more efficient than the default.

* :meth:`fs.base.FS.appendbytes`
* :meth:`fs.base.FS.appendtext`
Expand Down
1 change: 0 additions & 1 deletion tests/test_ftpfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from ftplib import error_perm
from ftplib import error_temp


from pyftpdlib.authorizers import DummyAuthorizer
from pyftpdlib.handlers import FTPHandler
from pyftpdlib.servers import FTPServer
Expand Down
2 changes: 1 addition & 1 deletion tests/test_iotools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from fs import iotools
from fs import tempfs

from .test_fs import UNICODE_TEXT
from fs.test import UNICODE_TEXT


class TestIOTools(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_zipfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from fs import zipfs
from fs.compress import write_zip
from fs.opener import open_fs
from fs.test import FSTestCases

from .test_fs import FSTestCases
from .test_archives import ArchiveTestCases


Expand Down

0 comments on commit c08f259

Please sign in to comment.