<classResult _class='hudson.tasks.junit.ClassResult'><child><age>0</age><className>OmeroPy.test.integration.clitest.test_cleanse.TestCleanseFullAdmin</className><duration>16.122</duration><failedSince>0</failedSince><name>testCleanseBasic</name><properties></properties><skipped>false</skipped><status>PASSED</status></child><child><age>4</age><className>OmeroPy.test.integration.clitest.test_cleanse.TestCleanseFullAdmin</className><duration>21.662</duration><errorDetails>AssertionError: assert not True
 +  where True = &lt;function exists at 0x7f18d6b6f420&gt;('/home/omero/workspace/OMERO-test-integration/data/ManagedRepository/fb09f691-6914-4d8a-957c-dc8526d6ae91_3325/2026-07/09/')
 +    where &lt;function exists at 0x7f18d6b6f420&gt; = &lt;module 'posixpath' (frozen)&gt;.exists
 +      where &lt;module 'posixpath' (frozen)&gt; = os.path</errorDetails><errorStackTrace>self = &lt;test.integration.clitest.test_cleanse.TestCleanseFullAdmin object at 0x7f18419f6310&gt;
capsys = &lt;_pytest.capture.CaptureFixture object at 0x7f18347502d0&gt;

    def testCleanseNonsenseName(self, capsys):
        """
        Test cleanse removes file on disk after OriginalFile
        name was changed to nonsense and its Image was deleted
        """
        # import image and retrieve the OriginalFile
        # (orig_file), its name and path
        image = self.import_fake_file()[0]
        fileset = self.get_fileset([image])
        params = omero.sys.ParametersI()
        params.addId(fileset.getId())
        q = ("select originalFile.path, originalFile.id "
             "from FilesetEntry where fileset.id = :id")
        queryService = self.root.sf.getQueryService()
        result = queryService.projection(q, params, self.group_ctx)
        path_in_mrepo = result[0][0].getValue()
        orig_file_path = self.make_path(path_in_mrepo)
        assert os.path.exists(orig_file_path)
        orig_file_id = result[0][1].getValue()
        orig_file = self.query.get("OriginalFile", orig_file_id)
        orig_file_name = orig_file.getName().getValue()
        orig_file_path_and_name = self.make_path(path_in_mrepo, orig_file_name)
        assert os.path.isfile(orig_file_path_and_name)
    
        # retrieve the logfile, its name and path
        q = ("select o from FilesetJobLink l "
             "join l.parent as fs join l.child as j "
             "join j.originalFileLinks l2 join l2.child as o "
             "where fs.id = :id and "
             "o.mimetype = 'application/omero-log-file'")
        logfile = queryService.findByQuery(q, params, self.group_ctx)
        logfile_name = logfile.getName().getValue()
        path_in_mrepo = logfile.getPath().getValue()
        logfile_path = self.make_path(path_in_mrepo)
        assert os.path.exists(logfile_path)
        logfile_path_and_name = self.make_path(path_in_mrepo, logfile_name)
        assert os.path.isfile(logfile_path_and_name)
    
        # change the names of original_file and logfile to nonsense
        name = "nonsensical"
        update_service = self.root.sf.getUpdateService()
        orig_file.setName(omero.rtypes.rstring(name))
        update_service.saveAndReturnObject(orig_file, self.group_ctx)
        logfile.setName(omero.rtypes.rstring(name))
        update_service.saveAndReturnObject(logfile, self.group_ctx)
    
        # run the cleanse command, which will not delete
        # the files on disk
        self.args += [self.data_dir]
        self.cli.invoke(self.args, strict=True)
        assert os.path.exists(orig_file_path)
        assert os.path.isfile(orig_file_path_and_name)
        assert os.path.exists(logfile_path)
        assert os.path.isfile(logfile_path_and_name)
    
        # delete the image, which will not delete
        # the files on disk because of the nonsensical name
        # of orig_file and logfile
        command = Delete2(targetObjects={"Image": [image.id.val]})
        handle = self.client.sf.submit(command)
        self.wait_on_cmd(self.client, handle)
        assert os.path.exists(orig_file_path)
        assert os.path.isfile(orig_file_path_and_name)
        assert os.path.exists(logfile_path)
        assert os.path.isfile(logfile_path_and_name)
    
        # run cleanse command again, which will now delete the
        # files on disk, the original file, the logfile
        # and their directories
        self.cli.invoke(self.args, strict=True)
        out, err = capsys.readouterr()
        assert not os.path.exists(orig_file_path)
        assert not os.path.isfile(orig_file_path_and_name)
&gt;       assert not os.path.exists(logfile_path)
E       AssertionError: assert not True
E        +  where True = &lt;function exists at 0x7f18d6b6f420&gt;('/home/omero/workspace/OMERO-test-integration/data/ManagedRepository/fb09f691-6914-4d8a-957c-dc8526d6ae91_3325/2026-07/09/')
E        +    where &lt;function exists at 0x7f18d6b6f420&gt; = &lt;module 'posixpath' (frozen)&gt;.exists
E        +      where &lt;module 'posixpath' (frozen)&gt; = os.path

test/integration/clitest/test_cleanse.py:155: AssertionError</errorStackTrace><failedSince>1</failedSince><name>testCleanseNonsenseName</name><properties></properties><skipped>false</skipped><status>FAILED</status></child><failCount>1</failCount><name>TestCleanseFullAdmin</name><passCount>1</passCount><skipCount>0</skipCount></classResult>