示例#1
0
def test_get_git_url_default():
    service = 'giiiiiiiiiiit'
    expected = '[email protected]:services/%s.git' % service
    with (mock.patch('service_configuration_lib.read_service_configuration',
                     autospec=True)) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {}
        assert utils.get_git_url(service) == expected
        mock_read_service_configuration.assert_called_once_with(
            service, soa_dir=utils.DEFAULT_SOA_DIR)
示例#2
0
def test_get_git_url_default():
    service = 'giiiiiiiiiiit'
    expected = '[email protected]:services/%s.git' % service
    with (
        mock.patch('service_configuration_lib.read_service_configuration', autospec=True)
    ) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {}
        assert utils.get_git_url(service) == expected
        mock_read_service_configuration.assert_called_once_with(service, soa_dir=utils.DEFAULT_SOA_DIR)
示例#3
0
def test_get_git_url_provided_by_serviceyaml():
    service = 'giiiiiiiiiiit'
    expected = 'git@some_random_host:foobar'
    with (mock.patch('service_configuration_lib.read_service_configuration',
                     autospec=True)) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {'git_url': expected}
        assert utils.get_git_url(service) == expected
        mock_read_service_configuration.assert_called_once_with(
            service, soa_dir=utils.DEFAULT_SOA_DIR)
示例#4
0
def test_get_git_url_provided_by_serviceyaml():
    service = 'giiiiiiiiiiit'
    expected = 'git@some_random_host:foobar'
    with (
        mock.patch('service_configuration_lib.read_service_configuration', autospec=True)
    ) as mock_read_service_configuration:
        mock_read_service_configuration.return_value = {'git_url': expected}
        assert utils.get_git_url(service) == expected
        mock_read_service_configuration.assert_called_once_with(service, soa_dir=utils.DEFAULT_SOA_DIR)