Beispiel #1
0
 def test_index_dir_path(self):
     try:
         do1 = DirectoryObject("test_dir1", temporary=True)
         do2 = DirectoryObject("test_dir2", temporary=True)
         do1.parent = do2
         if do2.index(path=do1.path) is None:
             raise Exception("Parent hasn't been set")
     except Exception as exc:
         traceback.print_exc()
         self.fail(exc)
Beispiel #2
0
 def test_unparent_dir(self):
     try:
         do1 = DirectoryObject("test_dir1", temporary=True)
         do2 = DirectoryObject("test_dir2", temporary=True)
         do1.parent = do2
         do1.unparent()
         if do1.parent == do2 or do2.index(do1) is not None:
             raise Exception("Parent hasn't been unset")
     except Exception as exc:
         traceback.print_exc()
         self.fail(exc)