Esempio n. 1
0
 def test_get_writer_defers(self):
     wrq_datagram = WRQDatagram('foobar', 'NetASCiI', {})
     wrq_addr = ('127.0.0.1', 1069)
     wrq_mode = "octet"
     d = self.tftp._startSession(wrq_datagram, wrq_addr, wrq_mode)
     self.assertFalse(d.called)
     self.clock.advance(1)
     self.assertTrue(d.called)
     self.assertTrue(IWriter.providedBy(d.result.backend))
Esempio n. 2
0
 def test_get_writer_defers(self):
     wrq_datagram = WRQDatagram(b'foobar', b'NetASCiI', {})
     wrq_addr = ('127.0.0.1', 1069)
     wrq_mode = b"octet"
     d = self.tftp._startSession(wrq_datagram, wrq_addr, wrq_mode)
     self.assertFalse(d.called)
     self.clock.advance(1)
     self.assertTrue(d.called)
     self.assertTrue(IWriter.providedBy(d.result.backend))
Esempio n. 3
0
 def test_write_supported_by_default(self):
     b = FilesystemSynchronousBackend(self.temp_dir.path)
     writer = yield b.get_writer(b'dir/bar')
     self.assertTrue(IWriter.providedBy(writer))
Esempio n. 4
0
 def test_write_supported_by_default(self):
     b = FilesystemSynchronousBackend(self.temp_dir.path)
     writer = yield b.get_writer('dir/bar')
     self.assertTrue(IWriter.providedBy(writer))