Esempio n. 1
0
 def setUp(self):
   self.protocol_mock = Mock(spec=CarbonPickleClientProtocol)
   self.protocol_patch = patch(
     'carbon.client.CarbonPickleClientProtocol', new=Mock(return_value=self.protocol_mock))
   self.protocol_patch.start()
   carbon_client.settings = TestSettings()
   self.factory = CarbonPickleClientFactory(('127.0.0.1', 2003, 'a'))
   self.connected_factory = CarbonPickleClientFactory(('127.0.0.1', 2003, 'a'))
   self.connected_factory.buildProtocol(None)
   self.connected_factory.started = True
 def setUp(self):
   self.router_mock = Mock(spec=DatapointRouter)
   carbon_client.settings = TestSettings()  # reset to defaults
   factory = CarbonPickleClientFactory(('127.0.0.1', 2003, 'a'), self.router_mock)
   self.protocol = factory.buildProtocol(('127.0.0.1', 2003))
   self.transport = StringTransport()
   self.protocol.makeConnection(self.transport)
Esempio n. 3
0
 def setUp(self):
     carbon_client.settings = TestSettings()  # reset to defaults
     factory = CarbonPickleClientFactory(('127.0.0.1', 2003, 'a'))
     self.protocol = factory.buildProtocol(('127.0.0.1', 2003))
     self.transport = StringTransport()
     self.protocol.makeConnection(self.transport)