Ejemplo n.º 1
0
 def test_get_latest_tag__release_not_found(self):
     config = BaseProjectConfig(BaseGlobalConfig())
     github = self._make_github()
     github.repositories["CumulusCI"]._releases = []
     config.get_github_api = mock.Mock(return_value=github)
     with pytest.raises(GithubException):
         config.get_latest_tag()
Ejemplo n.º 2
0
 def test_get_latest_tag_beta(self):
     config = BaseProjectConfig(
         BaseGlobalConfig(),
         {
             "project": {
                 "git": {"prefix_beta": "beta/", "prefix_release": "release/"}
             }
         },
     )
     config.get_github_api = mock.Mock(return_value=self._make_github())
     result = config.get_latest_tag(beta=True)
     self.assertEqual("beta/1.0-Beta_2", result)
Ejemplo n.º 3
0
 def test_get_latest_tag_matching_prefix(self):
     config = BaseProjectConfig(
         BaseGlobalConfig(),
         {"project": {"git": {"prefix_beta": "beta/", "prefix_release": "rel/"}}},
     )
     github = self._make_github()
     github.repositories["CumulusCI"]._releases.append(
         DummyRelease("rel/0.9", "0.9")
     )
     config.get_github_api = mock.Mock(return_value=github)
     result = config.get_latest_tag()
     self.assertEqual("rel/0.9", result)
Ejemplo n.º 4
0
 def test_get_latest_tag_beta(self):
     config = BaseProjectConfig(
         BaseGlobalConfig(),
         {
             "project": {
                 "git": {"prefix_beta": "beta/", "prefix_release": "release/"}
             }
         },
     )
     config.get_github_api = mock.Mock(return_value=self._make_github())
     result = config.get_latest_tag(beta=True)
     self.assertEqual("beta/1.0-Beta_2", result)
Ejemplo n.º 5
0
 def test_get_latest_tag_matching_prefix(self):
     config = BaseProjectConfig(
         BaseGlobalConfig(),
         {"project": {"git": {"prefix_beta": "beta/", "prefix_release": "rel/"}}},
     )
     github = self._make_github()
     github.repositories["CumulusCI"]._releases.append(
         DummyRelease("rel/0.9", "0.9")
     )
     config.get_github_api = mock.Mock(return_value=github)
     result = config.get_latest_tag()
     self.assertEqual("rel/0.9", result)