(self)
| 1177 | self.assertEqual(os.listdir(dir), []) |
| 1178 | |
| 1179 | def test_unexpected_error(self): |
| 1180 | dir = tempfile.mkdtemp() |
| 1181 | self.addCleanup(os_helper.rmtree, dir) |
| 1182 | with mock.patch('tempfile._TemporaryFileWrapper') as mock_ntf, \ |
| 1183 | mock.patch('io.open', mock.mock_open()) as mock_open: |
| 1184 | mock_ntf.side_effect = KeyboardInterrupt() |
| 1185 | with self.assertRaises(KeyboardInterrupt): |
| 1186 | tempfile.NamedTemporaryFile(dir=dir) |
| 1187 | mock_open().close.assert_called() |
| 1188 | self.assertEqual(os.listdir(dir), []) |
| 1189 | |
| 1190 | # How to test the mode and bufsize parameters? |
| 1191 |
nothing calls this directly
no test coverage detected