INNER CODE UNIT · Python

commit

spantaleev/matrix-docker-ansible-deploy · bin/test-molecule-select-roles.py:71

    def commit(self):
        self.git.run("add", "--all")
        self.git.run("commit", "--quiet", "--allow-empty", "-m", "Test fixture")
        return self.git.commit("HEAD")

    def bump(self, image):
        path = self.path(selector.IMAGE_VARS)
        path.write_text(path.read_text().replace(f'"{image}:1"', f'"{image}:2"'))

    def selected(self, base=None):
        self.commit()
        with contextlib.redirect_stderr(io.StringIO()):
            return selector.select_roles(self.git, base or self.base)

    def test_livekit_bump_only_runs_its_consumer(self):
        self.bump("livekit")
        self.assertEqual(self.selected(), ["matrix-livekit"])

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…