Exemplo n.º 1
0
def test_PostconfBuiltin():
    with pytest.raises(SkipException):
        PostconfBuiltin(context_wrap(V_OUT1))

    with pytest.raises(ContentException):
        PostconfBuiltin(context_wrap(V_OUT3))

    p = PostconfBuiltin(context_wrap(V_OUT2))
    assert p['smtpd_tls_loglevel'] == '0'
    assert p['smtpd_tls_mandatory_ciphers'] == 'medium'
    assert p['smtpd_tls_mandatory_exclude_ciphers'] == ''
    assert p['smtpd_tls_mandatory_protocols'] == '!SSLv2, !SSLv3, !TLSv1'
Exemplo n.º 2
0
def test_doc_examples():
    env = {
        'postconfb': PostconfBuiltin(context_wrap(V_OUT2)),
        'postconf': Postconf(context_wrap(V_OUT2)),
        '_postconf': _Postconf(context_wrap(V_OUT2)),
    }
    failed, total = doctest.testmod(postconf, globs=env)
    assert failed == 0
Exemplo n.º 3
0
def test_invalid():
    with pytest.raises(SkipException):
        PostconfBuiltin(context_wrap("asdf"))
Exemplo n.º 4
0
def test_empty():
    with pytest.raises(SkipException):
        PostconfBuiltin(context_wrap(""))