コード例 #1
0
def test_get():
    ss = UserStateStorage()
    ss.clear()
    state = ss.get("app.handlers.admin", "*****@*****.**")
    assert_equal(state, ROUTE_FIRST_STATE)

    ss.set("app.handlers.admin", "*****@*****.**", "POSTING")
    state = ss.get("app.handlers.admin", "*****@*****.**")
    assert_equal(state, "POSTING")
コード例 #2
0
def test_set():
    ss = UserStateStorage()
    # start states should not be stored
    ss.set("app.handlers.admin", "*****@*****.**", "START")
    assert_equal(len(UserState.objects.all()), 0)

    ss.set("app.handlers.admin", "*****@*****.**", "POSTING")
    assert_equal(len(UserState.objects.all()), 1)

    ss.clear()
コード例 #3
0
def test_get():
    ss = UserStateStorage()
    ss.clear()
    state = ss.get("app.handlers.admin", "*****@*****.**")
    assert_equal(state, ROUTE_FIRST_STATE)

    ss.set("app.handlers.admin", "*****@*****.**", "POSTING")
    state = ss.get("app.handlers.admin", "*****@*****.**")
    assert_equal(state, "POSTING")
コード例 #4
0
def test_set():
    ss = UserStateStorage()
    # start states should not be stored
    ss.set("app.handlers.admin", "*****@*****.**", "START")
    assert_equal(len(UserState.objects.all()), 0)

    ss.set("app.handlers.admin", "*****@*****.**", "POSTING")
    assert_equal(len(UserState.objects.all()), 1)
    
    ss.clear()
コード例 #5
0
def test_clear():
    ss = UserStateStorage()
    ss.clear()
    assert_equal(len(UserState.objects.all()), 0)
コード例 #6
0
def test_clear():
    ss = UserStateStorage()
    ss.clear()
    assert_equal(len(UserState.objects.all()), 0)