Ejemplo n.º 1
0
def test_random_id():
    id_number = addressing.random_id()
    assert id_number
Ejemplo n.º 2
0
def test_random_id():
    id_number = addressing.random_id()
    assert id_number
Ejemplo n.º 3
0
from nose.tools import *
from lamson.testing import *
from lamson import mail
from config import settings
from app.model import addressing

user_real = '*****@*****.**'
user_id = "user-%s" % addressing.random_id()
host = 'myinboxisnota.tv'

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)


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_random_id():
    id_number = addressing.random_id()
    assert id_number
Ejemplo n.º 4
0
from nose.tools import *
from salmon.testing import *
from salmon import mail
from config import settings
from app.model import addressing

user_real = '*****@*****.**'
user_id = "user-%s" % addressing.random_id()
host = 'myinboxisnota.tv'


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)


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_random_id():