jumpserver/apps/common/tests.py

16 lines
363 B
Python
Raw Normal View History

2016-08-08 16:43:11 +00:00
from django.test import TestCase
# Create your tests here.
2019-06-24 14:16:39 +00:00
from .utils import random_string, signer
2019-06-24 14:16:39 +00:00
def test_signer_len():
results = {}
for i in range(1, 4096):
s = random_string(i)
encs = signer.sign(s)
results[i] = (len(encs)/len(s))
results = sorted(results.items(), key=lambda x: x[1], reverse=True)
print(results)