Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
a06c38b4
Commit
a06c38b4
authored
Jun 21, 2015
by
Paul Sokolovsky
Browse files
tests: Add testcase for open(..., "a").
parent
63b9e598
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/io/open_append.py
0 → 100644
View file @
a06c38b4
import
sys
try
:
import
_os
as
os
except
ImportError
:
import
os
if
not
hasattr
(
os
,
"unlink"
):
print
(
"SKIP"
)
sys
.
exit
()
try
:
os
.
unlink
(
"testfile"
)
except
OSError
:
pass
# Should create a file
f
=
open
(
"testfile"
,
"a"
)
f
.
write
(
"foo"
)
f
.
close
()
f
=
open
(
"testfile"
)
print
(
f
.
read
())
f
.
close
()
f
=
open
(
"testfile"
,
"a"
)
f
.
write
(
"bar"
)
f
.
close
()
f
=
open
(
"testfile"
)
print
(
f
.
read
())
f
.
close
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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