mirror of
https://github.com/sqlmapproject/sqlmap.git
synced 2026-06-28 20:40:58 +00:00
Minor refactoring
This commit is contained in:
parent
cbf5dbd29e
commit
69ba213db9
3 changed files with 9 additions and 4 deletions
|
|
@ -24,6 +24,11 @@ from lib.core.convert import (decodeHex, encodeHex, decodeBase64, encodeBase64,
|
|||
jsonize, dejsonize, base64pickle, base64unpickle)
|
||||
from lib.core.common import decodeDbmsHexValue
|
||||
|
||||
try:
|
||||
unichr = unichr
|
||||
except NameError:
|
||||
unichr = chr
|
||||
|
||||
RND = random.Random(0xC0FFEE)
|
||||
|
||||
|
||||
|
|
@ -79,7 +84,7 @@ class TestDecodeDbmsHexValue(unittest.TestCase):
|
|||
class TestByteTextConversion(unittest.TestCase):
|
||||
def test_ascii_roundtrip(self):
|
||||
for _ in range(1000):
|
||||
s = u"".join(unichr(RND.randint(0x20, 0x7e)) if sys.version_info[0] < 3 else chr(RND.randint(0x20, 0x7e)) for _ in range(RND.randint(0, 30)))
|
||||
s = u"".join(unichr(RND.randint(0x20, 0x7e)) for _ in range(RND.randint(0, 30)))
|
||||
self.assertEqual(getUnicode(getBytes(s)), s)
|
||||
|
||||
def test_unicode_roundtrip(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue