Exemplo n.º 1
0
def test_run_missing_checks_no_errors(mock_logger):
    PullBug.run_missing_checks(True, False, False, True)
    mock_logger.critical.assert_not_called()
Exemplo n.º 2
0
def test_run_missing_checks_no_rocket_chat_url(mock_logger):
    message = 'No ROCKET_CHAT_URL set. Please correct and try again.'
    with pytest.raises(ValueError):
        PullBug.run_missing_checks(True, False, False, True)
    mock_logger.critical.assert_called_once_with(message)
Exemplo n.º 3
0
def test_run_missing_checks_no_slack_channel(mock_logger):
    message = 'No SLACK_CHANNEL set. Please correct and try again.'
    with pytest.raises(ValueError):
        PullBug.run_missing_checks(True, False, True, False)
    mock_logger.critical.assert_called_once_with(message)
Exemplo n.º 4
0
def test_run_missing_checks_no_gitlab_api_key(mock_logger):
    message = 'No GITLAB_API_KEY set. Please correct and try again.'
    with pytest.raises(ValueError):
        PullBug.run_missing_checks(False, True, False, False)
    mock_logger.critical.assert_called_once_with(message)
Exemplo n.º 5
0
def test_run_missing_checks_no_github_token(mock_logger):
    message = 'No GITHUB_TOKEN set. Please correct and try again.'
    with pytest.raises(ValueError):
        PullBug.run_missing_checks(True, False, False, False)
    mock_logger.critical.assert_called_once_with(message)
Exemplo n.º 6
0
def test_run_missing_checks_no_github_or_gitlab(mock_logger):
    with pytest.raises(ValueError):
        PullBug.run_missing_checks(False, False, False, False)
    mock_logger.critical.assert_called_once_with(
        'Neither "github" nor "gitlab" flags were passed, one is required. Please correct and try again.'
    )