MCPcopy
hub / github.com/awslabs/aws-shell / test_can_open_in_read

Method test_can_open_in_read

tests/unit/test_utils.py:85–95  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

83 self.assertFalse(os.path.isfile(filename))
84
85 def test_can_open_in_read(self):
86 with temporary_file('r') as f:
87 filename = f.name
88 assert f.read() == ''
89 # Verify we can open the file again
90 # in another file descriptor.
91 with open(filename, 'w') as f2:
92 f2.write("foobar")
93 f.seek(0)
94 assert f.read() == "foobar"
95 self.assertFalse(os.path.isfile(filename))

Callers

nothing calls this directly

Calls 1

temporary_fileFunction · 0.90

Tested by

no test coverage detected