def test_document_move(server): doc = Document( name=pytest.ws_python_test_name, type='File', properties={ 'dc:title': 'bar.txt', }) assert repr(doc) folder = Document( name='Test', type='Folder', properties={ 'dc:title': 'Test' }) doc = server.documents.create(doc, parent_path=pytest.ws_root_path) folder = server.documents.create(folder, parent_path=pytest.ws_root_path) try: doc.move(pytest.ws_root_path + '/Test', 'new name') assert doc.path == pytest.ws_root_path + '/Test/new name' children = server.documents.get_children(folder.uid) assert len(children) == 1 assert children[0].uid == doc.uid finally: doc.delete() folder.delete() assert not server.documents.exists(path=doc.path)
def test_document_move(server): doc = Document(name=WORKSPACE_NAME, type="File", properties={"dc:title": "bar.txt"}) assert repr(doc) folder = Document(name="Test", type="Folder", properties={"dc:title": "Test"}) doc = server.documents.create(doc, parent_path=WORKSPACE_ROOT) folder = server.documents.create(folder, parent_path=WORKSPACE_ROOT) try: doc.move(WORKSPACE_ROOT + "/Test", "new name") assert doc.path == WORKSPACE_ROOT + "/Test/new name" children = server.documents.get_children(folder.uid) assert len(children) == 1 assert children[0].uid == doc.uid finally: doc.delete() folder.delete() assert not server.documents.exists(path=doc.path)
def test_document_move(server): doc = Document(name=pytest.ws_python_test_name, type='File', properties={ 'dc:title': 'bar.txt', }) assert repr(doc) folder = Document(name='Test', type='Folder', properties={'dc:title': 'Test'}) doc = server.documents.create(doc, parent_path=pytest.ws_root_path) folder = server.documents.create(folder, parent_path=pytest.ws_root_path) try: doc.move(pytest.ws_root_path + '/Test', 'new name') assert doc.path == pytest.ws_root_path + '/Test/new name' children = server.documents.get_children(folder.uid) assert len(children) == 1 assert children[0].uid == doc.uid finally: doc.delete() folder.delete() assert not server.documents.exists(path=doc.path)