Skip to content

Commit 0526c3f

Browse files
committed
Additional acceptance tests.
1 parent 8035bd6 commit 0526c3f

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tests/testbed/src/testbed/common.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,20 @@ def test_ssl():
172172
ssl.get_default_verify_paths()
173173

174174

175+
def test_tempfile():
176+
"A tempfile can be written"
177+
import tempfile
178+
179+
msg = b"I've watched C-beams glitter in the dark near the Tannhauser Gate."
180+
with tempfile.TemporaryFile() as f:
181+
# Write content to the temp file
182+
f.write(msg)
183+
184+
# Reset the file pointer to 0 and read back the content
185+
f.seek(0)
186+
assert_(f.read() == msg)
187+
188+
175189
XML_DOCUMENT = """<?xml version="1.0"?>
176190
<data>
177191
<device name="iPhone">

tests/testbed/src/testbed/ios.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import errno
2+
13
from rubicon.objc import ObjCClass
24

35
from .utils import assert_
@@ -17,5 +19,6 @@ def test_subprocess():
1719
try:
1820
subprocess.call(['uname', '-a'])
1921
raise AssertionError('Subprocesses should not be possible')
20-
except RuntimeError as e:
21-
assert_(str(e) == "Subprocesses are not supported on ios")
22+
except OSError as e:
23+
assert_(e.errno == errno.ENOTSUP)
24+
assert_(str(e) == "[Errno 45] ios does not support processes.")

0 commit comments

Comments
 (0)