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)
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)
def setUp(self): self.factory = stubs.FactoryStub() self.brick = stubs.BrickStub(self.factory, "test")