Exemplo n.º 1
0
    def test_get_release_applicable(self, get_release, tag_is_release):
        push = {"ref": "refs/tags/release-1", "head_commit": "abc123"}
        repo = mock.Mock()
        repo.release_tag_regex = r"refs/tags/release-1"

        get_release.return_value = True
        tag_is_release.return_value = True

        release = views.get_release_if_applicable(push, repo)

        assert release == True
Exemplo n.º 2
0
 def test_get_release_not_applicable(self):
     push = {"ref": "refs/tags/test-tag"}
     repo = mock.Mock(release_tag_regex=False)
     actual = views.get_release_if_applicable(push, repo)
     assert actual is None
Exemplo n.º 3
0
 def test_get_release_if_applicable__no_ref(self):
     payload = {}
     repo = mock.Mock()
     result = views.get_release_if_applicable(payload, repo)
     assert result is None