def test_get_domain_should_have_expected_domain(
    hvcs,
    hvcs_domain,
    expected_domain,
    expected_api_url,
    ci_server_host,
    hvcs_api_domain,
):

    with mock.patch(
        "semantic_release.hvcs.config.get",
        wrapped_config_get(
            hvcs_domain=hvcs_domain, hvcs=hvcs, hvcs_api_domain=hvcs_api_domain
        ),
    ):
        with mock.patch(
            "os.environ",
            {
                "GL_TOKEN": "token",
                "GH_TOKEN": "token",
                "GITEA_TOKEN": "token",
                "CI_SERVER_HOST": ci_server_host,
            },
        ):

            assert get_hvcs().domain() == expected_domain
            assert get_hvcs().api_url() == expected_api_url
def test_get_domain_and_token(mock_get_vcs):
    assert (get_hvcs().domain())
    assert (get_hvcs().token())
def test_get_hvcs_should_return_gitlab(mock_get_vcs):
    assert (get_hvcs() == Gitlab)
Esempio n. 4
0
def test_get_hvcs_should_return_github():
    assert (get_hvcs() == Github)
 def test_get_hvcs_should_return_github(self):
     self.assertEqual(get_hvcs(), Github)
def test_get_hvcs_should_return_gitlab():
    assert get_hvcs() == Gitlab
def test_get_token():

    assert get_hvcs().token() == "token"
def test_ghe_domain_should_be_retrieved_from_env():
    assert get_hvcs().domain() == "github.enterprise"
    assert get_hvcs().api_url() == "https://api.github.enterprise"
def test_get_hvcs_should_return_github():
    assert(get_hvcs() == Github)
def test_get_domain_and_token():
    assert get_hvcs().domain()
    assert get_hvcs().token()
Esempio n. 11
0
def test_get_hvcs_should_return_github(mock_get_vcs):
    assert get_hvcs() == Github