File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
tests/testbed/src/testbed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,20 @@ def test_ssl():
172
172
ssl .get_default_verify_paths ()
173
173
174
174
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
+
175
189
XML_DOCUMENT = """<?xml version="1.0"?>
176
190
<data>
177
191
<device name="iPhone">
Original file line number Diff line number Diff line change
1
+ import errno
2
+
1
3
from rubicon .objc import ObjCClass
2
4
3
5
from .utils import assert_
@@ -17,5 +19,6 @@ def test_subprocess():
17
19
try :
18
20
subprocess .call (['uname' , '-a' ])
19
21
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." )
You can’t perform that action at this time.
0 commit comments