예제 #1
0
 def test_is_ascii_safe(self):
     "test is_ascii_safe()"
     from passlib.utils import is_ascii_safe
     self.assertTrue(is_ascii_safe(b("\x00abc\x7f")))
     self.assertTrue(is_ascii_safe(u("\x00abc\x7f")))
     self.assertFalse(is_ascii_safe(b("\x00abc\x80")))
     self.assertFalse(is_ascii_safe(u("\x00abc\x80")))
예제 #2
0
 def test_is_ascii_safe(self):
     "test is_ascii_safe()"
     from passlib.utils import is_ascii_safe
     self.assertTrue(is_ascii_safe(b("\x00abc\x7f")))
     self.assertTrue(is_ascii_safe(u("\x00abc\x7f")))
     self.assertFalse(is_ascii_safe(b("\x00abc\x80")))
     self.assertFalse(is_ascii_safe(u("\x00abc\x80")))
예제 #3
0
 def test_is_ascii_safe(self):
     "test is_ascii_safe()"
     self.assertTrue(is_ascii_safe(b("\x00abc\x7f")))
     self.assertTrue(is_ascii_safe(u"\x00abc\x7f"))
     self.assertFalse(is_ascii_safe(b("\x00abc\x80")))
     self.assertFalse(is_ascii_safe(u"\x00abc\x80"))
예제 #4
0
 def consteq_supports_string(value):
     # under PY2, it supports all unicode strings (when present at all),
     # under PY3, compare_digest() only supports ascii unicode strings.
     # confirmed for: cpython 2.7.9, cpython 3.4, pypy, pypy3, pyston
     return (consteq is str_consteq or PY2 or is_ascii_safe(value))
예제 #5
0
 def consteq_supports_string(value):
     # under PY2, it supports all unicode strings (when present at all),
     # under PY3, compare_digest() only supports ascii unicode strings.
     # confirmed for: cpython 2.7.9, cpython 3.4, pypy, pypy3, pyston
     return (consteq is str_consteq or PY2 or is_ascii_safe(value))
예제 #6
0
 def test_is_ascii_safe(self):
     "test is_ascii_safe()"
     self.assertTrue(is_ascii_safe(b("\x00abc\x7f")))
     self.assertTrue(is_ascii_safe(u"\x00abc\x7f"))
     self.assertFalse(is_ascii_safe(b("\x00abc\x80")))
     self.assertFalse(is_ascii_safe(u"\x00abc\x80"))