(self)
| 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 | |
| 224 | class NoNameFileTestCase(unittest.TestCase): |