diff --git a/tests/test_file.py b/tests/test_file.py index cc0707a9a5b9aeb4c8101b4d759f9afbc7b85ace..ffe8d9b0ef7411779b30c200659f94699b0de10b 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -158,7 +158,7 @@ def test_consistency_file_was_modified(): assert c.messages["Error", 0] is not None assert c.messages["Error", - 0][0] == 'CHANGED:HASH - DEFAULT:debug/test_file_storage_consistency' + 0][0] == 'CHANGED:SIZE - DEFAULT:debug/test_file_storage_consistency' # download file again and check if it is still the same (just to be # sure that the server only simulated the consistency breach @@ -303,7 +303,7 @@ def test_consistency_file_was_modified_2(): assert c.messages["Error", 0] is not None assert c.messages["Error", - 0][0] == 'CHANGED:HASH - DEFAULT:debug/test_file_storage_consistency' + 0][0] == 'CHANGED:SIZE - DEFAULT:debug/test_file_storage_consistency' # old checksum is still stored qfile = execute_query("FIND FILE TestConsistency3", unique=True) @@ -344,3 +344,5 @@ def test_consistency_file_was_modified_2(): qfile = execute_query("FIND FILE TestConsistency3", unique=True) assert qfile.id == file_.id assert qfile.checksum.lower() == checksum2 + +# TODO test modified file with constant size and modified hash diff --git a/tests/test_issues_server.py b/tests/test_issues_server.py index 2ae665e26e78c36e9b7d79430e20575ed2da0156..7f76085d1b675968f0aed29678fe9b89caaf0e7e 100644 --- a/tests/test_issues_server.py +++ b/tests/test_issues_server.py @@ -156,35 +156,6 @@ def test_issue_85_b(): C.update() # Failed at this step -@pytest.mark.local_server -def test_issue_99(): - """Checksum updating failed with versioning enabled. - """ - - # Using files in extroot, because this allows us to update the file - # content from the outside. - local_dir = os.path.join(db.get_config().get("IntegrationTests", - "test_files.test_insert_files_in_dir.local"), - "test_issue_99") - docker_dir = os.path.join(db.get_config().get("IntegrationTests", - "test_files.test_insert_files_in_dir.server"), - "test_issue_99") - os.makedirs(local_dir, exist_ok=True) - with tempfile.NamedTemporaryFile(dir=local_dir) as file_99: - # Create File entity in CaosDB - file_99.write("test 99\n".encode()) - os.fchmod(file_99.fileno(), 0o744) # make the file world readable - cont = db.Container() - cont.insert(unique=False, raise_exception_on_error=False, - flags={"InsertFilesInDir": docker_dir}) - dbfile = cont[0] - - # Checksum should exist after a short time - time.sleep(1) - dbfile.retrieve() - assert dbfile.checksum is not None - - def test_issue_110(): """query ignores ID: FIND MusicalInstrument which is referenced by Analysis with ID=124 """ cont = db.Container() diff --git a/tests/test_tickets_200.py b/tests/test_tickets_200.py index b6af11aef5d37903fb53de2a96c48a3e44ac98df..fde2c18dd36be3eadcd684e9bd4c2f2c5d2472a8 100644 --- a/tests/test_tickets_200.py +++ b/tests/test_tickets_200.py @@ -174,53 +174,6 @@ def test_ticket_221(): assert repr(RT2) == '<RecordType name="TestRT2">\n <Property name="test_property_with_RT1" datatype="TestRT1" importance="RECOMMENDED" flag="inheritance:FIX"/>\n</RecordType>\n' -def test_ticket_237(): - - f1 = h.File( - name="name1", - path="path1", - pickup="pickup1", - file="file1", - thumbnail="thumbnail1") - assert f1.name == "name1" - assert f1.path == "path1" - assert f1.pickup == "pickup1" - assert f1.file == "file1" - assert f1.thumbnail == "thumbnail1" - - f2 = h.File(name="name2") - assert f2.name == "name2" - assert f2.path is None - assert f2.pickup is None - assert f2.file is None - assert f2.thumbnail is None - - f2._wrap(f1) - - assert f2.name == "name2" - assert f2.path == "path1" - assert f2.pickup == "pickup1" - assert f2.file == "file1" - assert f2.thumbnail == "thumbnail1" - - f2.path = "path2" - f2.pickup = "pickup2" - f2.file = "file2" - f2.thumbnail = "thumbnail2" - - assert f2.name == "name2" - assert f2.path == "path2" - assert f2.pickup == "pickup2" - assert f2.file == "file2" - assert f2.thumbnail == "thumbnail2" - - assert f1.name == "name1" - assert f1.path == "path1" - assert f1.pickup == "pickup1" - assert f1.file == "file1" - assert f1.thumbnail == "thumbnail1" - - def test_ticket_238(): c = h.Container()