Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
e3632b73
Commit
e3632b73
authored
Sep 09, 2013
by
willmcgugan@gmail.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added test for read(0) (should return empty string)
parent
5bd02f37
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
fs/tests/__init__.py
+8
-0
No files found.
fs/tests/__init__.py
View file @
e3632b73
...
@@ -884,6 +884,14 @@ class FSTestCases(object):
...
@@ -884,6 +884,14 @@ class FSTestCases(object):
def
test_removeroot
(
self
):
def
test_removeroot
(
self
):
self
.
assertRaises
(
RemoveRootError
,
self
.
fs
.
removedir
,
"/"
)
self
.
assertRaises
(
RemoveRootError
,
self
.
fs
.
removedir
,
"/"
)
def
test_zero_read
(
self
):
"""Test read(0) returns empty string"""
self
.
fs
.
setcontents
(
'foo.txt'
,
b
(
'Hello, World'
),
'wb'
)
with
self
.
fs
.
open
(
'foo.txt'
,
'rb'
)
as
f
:
self
.
assert_
(
len
(
f
.
read
(
0
))
==
0
)
with
self
.
fs
.
open
(
'foo.txt'
,
'rt'
)
as
f
:
self
.
assert_
(
len
(
f
.
read
(
0
))
==
0
)
# May be disabled - see end of file
# May be disabled - see end of file
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment