Skip to content

Commit

Permalink
add tests for appfs
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Nov 20, 2016
1 parent 96f3059 commit 7bdc565
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
20 changes: 18 additions & 2 deletions fs/mode.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,27 @@
class Mode(object):
"""
A mode object provides properties that can be used to interrogate
the mode strings used when opening files.
the `mode
strings <https://docs.python.org/3/library/functions.html#open>`_ used
when opening files.
:param str mode: A *mode* as used by ``open``.
:param str mode: A *mode* string, as used by ``io.open``.
:raises ValueError: If the mode string is invalid.
Here's an example of typical use::
>>> mode = Mode('rb')
>>> mode.reading
True
>>> mode.writing
False
>>> mode.binary
True
>>> mode.text
False
"""

def __init__(self, mode):
Expand Down
2 changes: 1 addition & 1 deletion fs/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _make_details_from_stat(cls, stat_result):
'size': stat_result.st_size,
'type': int(cls._get_type_from_stat(stat_result))
}
if hasattr(stat, 'st_birthtime'):
if hasattr(stat_result, 'st_birthtime'):
details['created'] = stat_result.st_birthtime
ctime_key = (
'created'
Expand Down

0 comments on commit 7bdc565

Please sign in to comment.