MCPcopy
hub / github.com/django/django / test_open_supports_full_signature

Method test_open_supports_full_signature

tests/files/tests.py:208–221  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

206 self.assertIs(locks.unlock(f2), True)
207
208 def test_open_supports_full_signature(self):
209 called = False
210
211 def opener(path, flags):
212 nonlocal called
213 called = True
214 return os.open(path, flags)
215
216 file_path = Path(__file__).parent / "test.png"
217 with open(file_path) as f:
218 test_file = File(f)
219
220 with test_file.open(opener=opener):
221 self.assertIs(called, True)
222
223
224class NoNameFileTestCase(unittest.TestCase):

Callers

nothing calls this directly

Calls 2

openMethod · 0.95
FileClass · 0.90

Tested by

no test coverage detected