Пример #1
0
def test_ac_check_mail_main_failed_connect(check_mail):
    state, info, perf = _active_check_main_core(
        check_mail.create_argument_parser(),
        check_mail.check_mail,
        ['--fetch-server', 'foo', '--fetch-username', 'bar', '--fetch-password', 'baz'],
    )
    assert state == 2
    assert info.startswith('Failed to connect to foo:143:')
    assert perf is None
Пример #2
0
def test_ac_check_mail_main_failed_connect(check_mail):
    state, info, perf = _active_check_main_core(
        check_mail.create_argument_parser(),
        check_mail.check_mail,
        [
            "--fetch-server", "foo", "--fetch-username", "bar",
            "--fetch-password", "baz"
        ],
    )
    assert state == 2
    assert info.startswith("Failed to connect to foo:143:")
    assert perf is None
Пример #3
0
def test_ac_check_mail_main_loop_failed_to_send_mail(check_mail_loop):
    state, info, perf = _active_check_main_core(
        check_mail_loop.create_argument_parser(),
        check_mail_loop.check_mail_roundtrip,
        [
            "--smtp-server",
            "foo",
            "--fetch-server",
            "bar",
            "--fetch-username",
            "baz",
            "--fetch-password",
            "passw",
            "--mail-from",
            "from",
            "--mail-to",
            "to",
        ],
    )
    assert state == 3
    assert info.startswith("Failed to")
    assert perf is None
Пример #4
0
def test_ac_check_mail_main_loop_failed_to_send_mail(check_mail_loop):
    state, info, perf = _active_check_main_core(
        check_mail_loop.create_argument_parser(),
        check_mail_loop.check_mail_roundtrip,
        [
            '--smtp-server',
            'foo',
            '--fetch-server',
            'bar',
            '--fetch-username',
            'baz',
            '--fetch-password',
            'passw',
            '--mail-from',
            'from',
            '--mail-to',
            'to',
        ],
    )
    assert state == 3
    assert info.startswith('Failed to')
    assert perf is None