Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F18425561
MemoryReactor example
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
Vgutierrez
May 21 2018, 4:04 PM
2018-05-21 16:04:30 (UTC+0)
Size
880 B
Referenced Files
None
Subscribers
None
MemoryReactor example
View Options
@mock.patch('pybal.monitors.proxyfetch.reactor', new_callable=twisted.test.proto_helpers.MemoryReactor)
def testGetProxyPageHTTP(self, mock_reactor):
testURL = "http://en.wikipedia.org/"
host = "cp1001.eqiad.wmnet"
port = 80
r = ProxyFetchMonitoringProtocol.getProxyPage(testURL, host=host, port=port)
self.assertIsInstance(r, defer.Deferred)
self.assertTrue(len(pybal.monitors.proxyfetch.reactor.tcpClients) == 1)
self.assertEqual(pybal.monitors.proxyfetch.reactor.tcpClients[-1][0], host)
self.assertEqual(pybal.monitors.proxyfetch.reactor.tcpClients[-1][1], port)
self.assertIsInstance(pybal.monitors.proxyfetch.reactor.tcpClients[-1][2],
twisted.web.client.HTTPClientFactory)
self.assertEqual(pybal.monitors.proxyfetch.reactor.tcpClients[-1][2].url, testURL)
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5833724
Default Alt Text
MemoryReactor example (880 B)
Attached To
Mode
P7142 MemoryReactor example
Attached
Detach File
Event Timeline
Log In to Comment