Ejemplo n.º 1
0
def test_make_and_parse_header_prefer_encrypt():
    addr, keydata = "[email protected]", b64encode(b'123')
    h = mime.make_ac_header_value(addr=addr,
                                  keydata=keydata,
                                  prefer_encrypt="notset")
    r = mime.parse_ac_headervalue(h)
    assert "notset" in r.error
    assert not r.keydata
Ejemplo n.º 2
0
def test_make_and_parse_header_value():
    addr, keydata = "[email protected]", b64encode(b'123')
    h = mime.make_ac_header_value(addr=addr, keydata=keydata)
    r = mime.parse_ac_headervalue(h)
    assert not r.error
    assert r.keydata == keydata
    assert r.addr == addr
    assert not r.extra_attr
Ejemplo n.º 3
0
def test_make_and_parse_header_value_with_full_addr(addr):
    addr, keydata = "name <{}>".format(addr), b64encode(b'123')
    h = mime.make_ac_header_value(addr=addr, keydata=keydata)
    assert "[email protected]" in h
    r = mime.parse_ac_headervalue(h)
    assert not r.error
    assert r.keydata == keydata
    assert r.addr == "[email protected]"
    assert not r.extra_attr