コード例 #1
0
 def test_cancelled_write(self):
     w = FilesystemWriter(self.temp_dir.child(b'bar'))
     w.write(self.test_data)
     w.cancel()
     self.assertFalse(
         self.temp_dir.child(b'bar').exists(),
         "If a write is cancelled, the file should not be left behind")
コード例 #2
0
 def test_finished_write(self):
     w = FilesystemWriter(self.temp_dir.child(b'bar'))
     w.write(self.test_data)
     w.finish()
     with self.temp_dir.child(b'bar').open() as f:
         self.assertEqual(f.read(), self.test_data)
コード例 #3
0
ファイル: test_sessions.py プロジェクト: viert/python-tx-tftp
 def c(ign):
     return FilesystemWriter.write(self, data)
コード例 #4
0
ファイル: test_backend.py プロジェクト: deepakhajare/maas
 def test_cancelled_write(self):
     w = FilesystemWriter(self.temp_dir.child('bar'))
     w.write(self.test_data)
     w.cancel()
     self.failIf(self.temp_dir.child('bar').exists(),
                 "If a write is cancelled, the file should not be left behind")
コード例 #5
0
ファイル: test_backend.py プロジェクト: deepakhajare/maas
 def test_finished_write(self):
     w = FilesystemWriter(self.temp_dir.child('bar'))
     w.write(self.test_data)
     w.finish()
     with self.temp_dir.child('bar').open() as f:
         self.assertEqual(f.read(), self.test_data)
コード例 #6
0
ファイル: test_sessions.py プロジェクト: rvbad/python-tx-tftp
 def c(ign):
     return FilesystemWriter.write(self, data)