Exemplo n.º 1
0
 def setUp(self):
     self.factory = stubs.FactoryStub()
     self.brick = stubs.BrickStub(self.factory, "test")
     self.plug = self.plug_factory(self.brick)
     self.log = []
     log.addObserver(self.log.append)
     self.addCleanup(log.removeObserver, self.log.append)
Exemplo n.º 2
0
 def test_add_plug_sock(self):
     brick = stubs.BrickStub(self.factory, "test")
     sock = vm.VMSock(self.factory.new_sock(brick))
     plug = self.vm.add_plug(sock)
     self.assertEqual(plug.mode, "vde")
     self.assertEqual(len(self.vm.plugs), 1)
     self.assertIs(plug.sock, sock)
     self.assertEqual(len(sock.plugs), 1)
Exemplo n.º 3
0
 def setUp(self):
     self.factory = stubs.FactoryStub()
     self.brick = stubs.BrickStub(self.factory, "test")