Exemplo n.º 1
0
def test_autoVerifyExpiredItems():
    curtime = time.time()
    expired_time = curtime
    future_time = curtime + 120

    rs.zadd(VERIFYING_SET, "expired", curtime)
    rs.zadd(VERIFYING_SET, "future_item", future_time)

    assert rs.zscore(VERIFYING_SET, "expired") == curtime

    update.autoVerifyExpiredItems()

    assert not rs.zscore(VERIFYING_SET, "expired")
    assert rs.zscore(VERIFYING_SET, "future_item") == future_time
    assert rs.get(NEWITEM+"expired") == "expired"

    rs.zrem(VERIFYING_SET, "future_item")
    rs.delete(NEWITEM+"expired")
Exemplo n.º 2
0
def test_autoVerifyExpiredItems():
    curtime = time.time()
    expired_time = curtime
    future_time = curtime + 120

    rs.zadd(VERIFYING_SET, "expired", curtime)
    rs.zadd(VERIFYING_SET, "future_item", future_time)

    assert rs.zscore(VERIFYING_SET, "expired") == curtime

    update.autoVerifyExpiredItems()

    assert not rs.zscore(VERIFYING_SET, "expired")
    assert rs.zscore(VERIFYING_SET, "future_item") == future_time
    assert rs.get(NEWITEM + "expired") == "expired"

    rs.zrem(VERIFYING_SET, "future_item")
    rs.delete(NEWITEM + "expired")
Exemplo n.º 3
0
def test_filterExistedItems():
    _deletePrefix(NEWITEM)
    _deletePrefix(EDITED)
    rs.delete(VERIFYING_SET)

    rs.set(NEWITEM + "newitem", "newitem")
    rs.set(EDITED + "edited", "edited")
    rs.zadd(VERIFYING_SET, "verifying", 1)

    assert not update.filterExistedItems("newitem")
    assert not update.filterExistedItems("edited")
    assert not update.filterExistedItems("verifying")
    assert update.filterExistedItems("shouldnotexisted")

    rs.delete(NEWITEM + "newitem")
    rs.delete(EDITED + "edited")
    rs.zrem(VERIFYING_SET, "verifying")
Exemplo n.º 4
0
def test_filterExistedItems():
    _deletePrefix(NEWITEM)
    _deletePrefix(EDITED)
    rs.delete(VERIFYING_SET)


    rs.set(NEWITEM+"newitem", "newitem")
    rs.set(EDITED+"edited", "edited")
    rs.zadd(VERIFYING_SET, "verifying", 1)

    assert not update.filterExistedItems("newitem")
    assert not update.filterExistedItems("edited")
    assert not update.filterExistedItems("verifying")
    assert update.filterExistedItems("shouldnotexisted")

    rs.delete(NEWITEM+"newitem")
    rs.delete(EDITED+"edited")
    rs.zrem(VERIFYING_SET, "verifying")
Exemplo n.º 5
0
 def teardown():
     rs.delete(mpconfig.MoePadConfKey)
Exemplo n.º 6
0
 def teardown():
     rs.delete(mpconfig.MoePadConfKey)
Exemplo n.º 7
0
def clean_auth(request):
    rs.delete('WeiboAuthoriginal')
    return render_to_response("info.html",
                              {'information': '授权信息已清除'})
Exemplo n.º 8
0
def clean_auth(request):
    rs.delete('WeiboAuthoriginal')
    return render_to_response("info.html", {'information': '授权信息已清除'})