Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Unified Diff: third_party/twisted_8_1/twisted/test/test_tpfile.py

Issue 12261012: Remove third_party/twisted_8_1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/twisted_8_1/twisted/test/test_tpfile.py
diff --git a/third_party/twisted_8_1/twisted/test/test_tpfile.py b/third_party/twisted_8_1/twisted/test/test_tpfile.py
deleted file mode 100644
index eaa1789ec237e796a38c316550c766fd84086060..0000000000000000000000000000000000000000
--- a/third_party/twisted_8_1/twisted/test/test_tpfile.py
+++ /dev/null
@@ -1,52 +0,0 @@
-
-# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
-# See LICENSE for details.
-
-
-from twisted.trial import unittest
-from twisted.protocols import loopback
-from twisted.protocols import basic
-from twisted.internet import protocol, abstract
-
-import StringIO
-
-class BufferingServer(protocol.Protocol):
- buffer = ''
- def dataReceived(self, data):
- self.buffer += data
-
-class FileSendingClient(protocol.Protocol):
- def __init__(self, f):
- self.f = f
-
- def connectionMade(self):
- s = basic.FileSender()
- d = s.beginFileTransfer(self.f, self.transport, lambda x: x)
- d.addCallback(lambda r: self.transport.loseConnection())
-
-class FileSenderTestCase(unittest.TestCase):
- def testSendingFile(self):
- testStr = 'xyz' * 100 + 'abc' * 100 + '123' * 100
- s = BufferingServer()
- c = FileSendingClient(StringIO.StringIO(testStr))
-
- d = loopback.loopbackTCP(s, c)
- d.addCallback(lambda x : self.assertEquals(s.buffer, testStr))
- return d
-
- def testSendingEmptyFile(self):
- fileSender = basic.FileSender()
- consumer = abstract.FileDescriptor()
- consumer.connected = 1
- emptyFile = StringIO.StringIO('')
-
- d = fileSender.beginFileTransfer(emptyFile, consumer, lambda x: x)
-
- # The producer will be immediately exhausted, and so immediately
- # unregistered
- self.assertEqual(consumer.producer, None)
-
- # Which means the Deferred from FileSender should have been called
- self.failUnless(d.called,
- 'producer unregistered with deferred being called')
-
« no previous file with comments | « third_party/twisted_8_1/twisted/test/test_timeoutqueue.py ('k') | third_party/twisted_8_1/twisted/test/test_twistd.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698