-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .state property to file tuples returned from JFSFileDirList(), an…
…d revamp logic to be more resilient to unexpected file objects. See #88
- Loading branch information
1 parent
84f6322
commit 6c844dd
Showing
2 changed files
with
41 additions
and
10 deletions.
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
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 |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
__author__ = '[email protected]' | ||
|
||
# import standardlib | ||
import os, logging, datetime | ||
import os, logging, datetime, types | ||
import tempfile, posixpath, urllib | ||
import six | ||
from six.moves import cStringIO as StringIO | ||
|
@@ -462,6 +462,14 @@ def test_api(self): | |
fdl = jfs.getObject('/Jotta/Sync/?mode=list') | ||
assert isinstance(fdl, JFS.JFSFileDirList) | ||
assert len(fdl.tree) > 0 | ||
i = 0 | ||
for folders in fdl.tree.values(): # iterate over all files in tree list | ||
for f in folders: | ||
assert isinstance(f.name, unicode) | ||
assert isinstance(f.md5, (basestring, types.NoneType)) | ||
assert isinstance(f.state, basestring) | ||
assert isinstance(f.uuid, basestring) | ||
assert isinstance(f.size, (int, types.NoneType)) | ||
|
||
class TestJFSError: | ||
'Test different JFSErrors' | ||
|