Example #1
0
def test_anon():
    addressing.store(user_real, user_id)

    user_anon = addressing.anon(user_real, host)
    assert_equal(user_anon, user_id + '@' + host)

    addressing.delete(user_real)
Example #2
0
def test_store_lookup_delete_with_dumb_addresses():
    addressing.store('"Zed Shaw" <*****@*****.**>', "fake")
    assert_equal("fake", addressing.lookup("*****@*****.**"))
    assert_equal("fake", addressing.lookup('"Zed Shaw" <*****@*****.**>'))
    addressing.delete("*****@*****.**")
    assert_raises(KeyError, addressing.lookup, "*****@*****.**")
    assert_raises(KeyError, addressing.lookup,'"Zed Shaw" <*****@*****.**>')
Example #3
0
def test_store_lookup_delete():
    addressing.store(user_id, user_real)
    addr = addressing.lookup(user_id)
    assert_equal(addr, user_real)

    addressing.delete(user_id)
    assert_raises(KeyError, addressing.lookup, user_id)
Example #4
0
def test_store_lookup_delete():
    addressing.store(user_id, user_real)
    addr = addressing.lookup(user_id)
    assert_equal(addr, user_real)
   
    addressing.delete(user_id)
    assert_raises(KeyError, addressing.lookup, user_id)
Example #5
0
def test_anon():
    addressing.store(user_real, user_id)

    user_anon = addressing.anon(user_real, host)
    assert_equal(user_anon, user_id + '@' + host)

    addressing.delete(user_real)
Example #6
0
def test_store_lookup_delete_with_dumb_addresses():
    addressing.store('"Zed Shaw" <*****@*****.**>', "fake")
    assert_equal("fake", addressing.lookup("*****@*****.**"))
    assert_equal("fake", addressing.lookup('"Zed Shaw" <*****@*****.**>'))
    addressing.delete("*****@*****.**")
    assert_raises(KeyError, addressing.lookup, "*****@*****.**")
    assert_raises(KeyError, addressing.lookup,
                  '"Zed Shaw" <*****@*****.**>')
Example #7
0
def test_mapping():
    anon = addressing.mapping(user_real, 'user', host)
    anon_id = anon.split('@')[0]

    assert_equal(addressing.lookup(anon_id), user_real)
    assert_equal(addressing.lookup(user_real), anon_id)
    assert_equal(addressing.lookup(anon_id), user_real)

    addressing.delete(anon_id)
    addressing.delete(user_real)
Example #8
0
def test_mapping():
    anon = addressing.mapping(user_real, 'user', host)
    anon_id = anon.split('@')[0]

    assert_equal(addressing.lookup(anon_id), user_real)
    assert_equal(addressing.lookup(user_real), anon_id)
    assert_equal(addressing.lookup(anon_id), user_real)

    addressing.delete(anon_id)
    addressing.delete(user_real)
Example #9
0
def test_client_receives_normal_mail():
    marketroid.begin()
    user_id = test_client_subscribes()
    
    to_user = marketroid.say(user_id, "I have a great offer for you!", "marketroid")

    assert to_user['reply-to'] != "buymycrap@localhost"
    to_marketroid = client.say(to_user['reply-to'], "I don't want your junk.", "user")
   
    assert to_marketroid['from'] != 'person@localhost'

    to_user2 = marketroid.say(to_marketroid['from'], "Hey you should buy my stuff.", "marketroid")

    assert_equal(to_user['reply-to'], to_user2['reply-to'])

    addressing.delete(user_id.split('@')[0])
Example #10
0
def test_client_receives_normal_mail():
    marketroid.begin()
    user_id = test_client_subscribes()
    
    to_user = marketroid.say(user_id, "I have a great offer for you!", "marketroid")

    assert to_user['reply-to'] != "buymycrap@localhost"
    to_marketroid = client.say(to_user['reply-to'], "I don't want your junk.", "user")
   
    assert to_marketroid['from'] != 'person@localhost'

    to_user2 = marketroid.say(to_marketroid['from'], "Hey you should buy my stuff.", "marketroid")

    assert_equal(to_user['reply-to'], to_user2['reply-to'])

    addressing.delete(user_id.split('@')[0])
Example #11
0
def teardown():
    addressing.delete(user_id)
    addressing.delete(marketroid_id)
    addressing.delete(marketroid)
Example #12
0
def teardown():
    addressing.delete(user_id)
    addressing.delete(marketroid_id)
    addressing.delete(marketroid)
Example #13
0
def teardown():
    addressing.delete("person@localhost")
    addressing.delete("buymycrap@localhost")
Example #14
0
def test_real():
    addressing.store(user_id, user_real)
    assert_equal(addressing.real(user_id), user_real)
    addressing.delete(user_id)
Example #15
0
def test_real():
    addressing.store(user_id, user_real)
    assert_equal(addressing.real(user_id), user_real)
    addressing.delete(user_id)
Example #16
0
def teardown():
    addressing.delete("person@localhost")
    addressing.delete("buymycrap@localhost")