Commit d93cddcf authored by Tristan Maat's avatar Tristan Maat
Browse files

testutils/runcli.py: Allow removing artifacts from arbitrary dirs

`remove_artifact_from_cache` used a hard-coded path to remove
artifacts, which wasn't sufficient for integration tests.
parent 4236bcc7
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -245,8 +245,14 @@ class Cli():

    def remove_artifact_from_cache(self, project, element_name,
                                   *, cache_dir=None):
        # Read configuration to figure out where artifacts are stored
        if not cache_dir:
            cache_dir = os.path.join(project, 'cache', 'artifacts')
            default = os.path.join(project, 'cache', 'artifacts')

            if self.config is not None:
                cache_dir = self.config.get('artifactdir', default)
            else:
                cache_dir = default

        cache_dir = os.path.join(cache_dir, 'cas', 'refs', 'heads')