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" <*****@*****.**>')
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" <*****@*****.**>')
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)
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)