コード例 #1
0
def test_long():
    key = 'A' * 242
    hashed_key = '%s[865768d1a3bbc7e33c749dc133260242]' % ('A' * 207)
    full_key = 'prefix:1:%s' % hashed_key
    assert full_key == make_key(key, 'prefix', 1)
コード例 #2
0
def test_short():
    key = 'A' * 241
    full_key = 'prefix:1:%s' % key
    assert full_key == make_key(key, 'prefix', 1)
コード例 #3
0
def test_space():
    assert make_key('hello world', 'prefix', '1') == 'prefix:1:helloworld[5eb63bbbe01eeed093cb22bb8f5acdc3]'
コード例 #4
0
def test_short():
    """ Test short keys. These keys don't require sanitizing. """
    key = 'A' * 241
    full_key = 'prefix:1:%s' % key
    assert full_key == make_key(key, 'prefix', 1)
コード例 #5
0
def test_space():
    """ Test for spaces in keys, which will need to be sanitized. """
    assert make_key('hello world', 'prefix', '1') == 'prefix:1:helloworld[3468387874]'
コード例 #6
0
def test_long():
    """ Test long keys, which will need to be sanitized. """
    key = 'A' * 242
    hashed_key = '%s[3705915182]' % ('A' * 229)
    full_key = 'prefix:1:%s' % hashed_key
    assert full_key == make_key(key, 'prefix', 1)