Kaydet (Commit) b55e0777 authored tarafından Aymeric Augustin's avatar Aymeric Augustin

[py3] Ported django.utils.baseconv.

üst 13338a63
from unittest import TestCase from unittest import TestCase
from django.utils.baseconv import base2, base16, base36, base56, base62, base64, BaseConverter from django.utils.baseconv import base2, base16, base36, base56, base62, base64, BaseConverter
from django.utils.six.moves import xrange
class TestBaseConv(TestCase): class TestBaseConv(TestCase):
def test_baseconv(self): def test_baseconv(self):
nums = [-10 ** 10, 10 ** 10] + range(-100, 100) nums = [-10 ** 10, 10 ** 10] + list(xrange(-100, 100))
for converter in [base2, base16, base36, base56, base62, base64]: for converter in [base2, base16, base36, base56, base62, base64]:
for i in nums: for i in nums:
self.assertEqual(i, converter.decode(converter.encode(i))) self.assertEqual(i, converter.decode(converter.encode(i)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment