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
929c9603
Commit
929c9603
authored
Mar 19, 2011
by
rfkelly0
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add testcase for writing past the end of a file
parent
c76fa552
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
fs/tests/__init__.py
+9
-0
No files found.
fs/tests/__init__.py
View file @
929c9603
...
@@ -741,6 +741,15 @@ class FSTestCases(object):
...
@@ -741,6 +741,15 @@ class FSTestCases(object):
f
.
seek
(
25
)
f
.
seek
(
25
)
self
.
assertEquals
(
f
.
read
(),
"123456"
)
self
.
assertEquals
(
f
.
read
(),
"123456"
)
def
test_write_past_end_of_file
(
self
):
if
self
.
fs
.
getmeta
(
'file.read_and_write'
,
True
):
with
self
.
fs
.
open
(
"write_at_end"
,
"w"
)
as
f
:
f
.
seek
(
25
)
f
.
write
(
"EOF"
)
with
self
.
fs
.
open
(
"write_at_end"
,
"r"
)
as
f
:
self
.
assertEquals
(
f
.
read
(),
"
\x00
"
*
25
+
"EOF"
)
def
test_with_statement
(
self
):
def
test_with_statement
(
self
):
# This is a little tricky since 'with' is actually new syntax.
# This is a little tricky since 'with' is actually new syntax.
# We use eval() to make this method safe for old python versions.
# We use eval() to make this method safe for old python versions.
...
...
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