Exemplo n.º 1
0
    def test_smart_escape_binary(self):
        s = '\x10\x11\x12\x13\x14'

        result = pureldap.smart_escape(s)
        expected = '\\10\\11\\12\\13\\14'

        self.assertEqual(expected, result)
Exemplo n.º 2
0
    def test_smart_escape_threshold(self):
        s = '\x10\x11ABC'

        result = pureldap.smart_escape(s, threshold=0.10)
        expected = '\\10\\11\\41\\42\\43'

        self.assertEqual(expected, result)
Exemplo n.º 3
0
    def test_smart_escape_regular(self):
        s = 'HELLO'

        result = pureldap.smart_escape(s)
        expected = 'HELLO'

        self.assertEqual(expected, result)