def test_valid_contextj(self): zwnj = u'\u200c' zwj = u'\u200d' virama = u'\u094d' latin = u'\u0061' # RFC 5892 Appendix A.1 (Zero Width Non-Joiner) self.assertFalse(idna.valid_contextj(zwnj, 0)) self.assertFalse(idna.valid_contextj(latin + zwnj, 1)) # No preceding Virama self.assertTrue(idna.valid_contextj(virama + zwnj, 1)) # Preceding Virama # RFC 5892 Appendix A.2 (Zero Width Joiner) self.assertFalse(idna.valid_contextj(zwj, 0)) self.assertFalse(idna.valid_contextj(latin + zwj, 1)) # No preceding Virama self.assertTrue(idna.valid_contextj(virama + zwj, 1)) # Preceding Virama
def test_valid_contextj(self): # RFC 5892 Appendix A.1 (Zero Width Non-Joiner) self.assertFalse(idna.valid_contextj(u'\u200c', 0)) self.assertFalse(idna.valid_contextj(u'\u0061\u200c', 1)) # No preceding Virama self.assertTrue(idna.valid_contextj(u'\u094d\u200d', 1)) # Preceding Virama