Beispiel #1
0
def test_css():
    c = Config()
    c.merge_config({'css_file': None})
    assert c.css == ''

    with tempfile.NamedTemporaryFile(delete=True) as css_file:
        css_file.write(b'html { background-color: black; }\n')
        css_file.flush()
        c.merge_config({'css_file': css_file.name})
        assert c.css == 'html { background-color: black; }\n'
Beispiel #2
0
def config_with_css(tempdir):
    with open('%s/test.css' % tempdir, 'w') as f:
        f.write('html, body, p { font-family: serif; }\n')
    c = Config()
    c.merge_config({'css_file': '%s/test.css' % tempdir})
    return c
Beispiel #3
0
def basic_config():
    return Config()
Beispiel #4
0
def test_smtp_password_literal():
    c = Config()
    c.merge_config({'smtp_password': '******'})
    assert c.smtp_password == 'foo'
Beispiel #5
0
def test_smtp_password_command():
    c = Config()
    c.merge_config({'smtp_password_command': 'sh -c "echo foo"'})
    assert c.smtp_password == 'foo'
Beispiel #6
0
def config_with_css(tmpdir):
    with open('%s/test.css' % tmpdir, 'w') as f:
        f.write('html, body, p { font-family: serif; }\n')
    c = Config()
    c.merge_config({'css_file': '%s/test.css' % tmpdir})
    return c