def test_insert_file(self): try: fo = FileObject("test_file", temporary=True) do = DirectoryObject("test_dir", temporary=True) do.insert(0, fo) if fo.parent != do or do.index(fo) is None: raise Exception("Parent hasn't been set") except Exception as exc: traceback.print_exc() self.fail(exc)
def test_insert_dir(self): try: do1 = DirectoryObject("test_dir1", temporary=True) do2 = DirectoryObject("test_dir2", temporary=True) do2.insert(0, do1) if do1.parent != do2 or do2.index(do1) is None: raise Exception("Parent hasn't been set") except Exception as exc: traceback.print_exc() self.fail(exc)