コード例 #1
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)
コード例 #2
0
 def sock_factory(brick):
     return vm.VMSock(link.Sock(brick))