Exemplo n.º 1
0
 def test_add_path(self, mock_ope):
     mock_vm = MagicMock()
     vinfo = vnode.VnodeInfo(mock_vm)
     self.assertEqual(0, vinfo.refcount)
     vinfo.add_path(vnode.AbsPath(self.TPATH))
     mock_vm.notify_path_add.assert_called_with(vinfo, self.TPATH)
     self.assertIn(self.TPATH, vinfo.paths)
     self.assertEqual(1, vinfo.refcount)
     vinfo.add_path(vnode.AbsPath(self.TPATH + '2'), inc_ref=False)
     self.assertEqual(1, vinfo.refcount)
Exemplo n.º 2
0
 def test_make_instance(self):
     mock_vm = MagicMock()
     vinfo = vnode.VnodeInfo(mock_vm)
     mock_vm.notify_vinfo_bind.assert_called_with(vinfo)
Exemplo n.º 3
0
 def configure_a(cls, manager, mock_mpe):
     vinfo = vnode.VnodeInfo(manager)
     vinfo.add_path(vnode.AbsPath(cls.TPATH + '1'))
     vinfo.add_path(vnode.AbsPath(cls.TPATH + '2'))
     return vinfo