How to use the idna.valid_contextj function in idna

To help you get started, we’ve selected a few idna examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kjd / idna / tests / test_idna.py View on Github external
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
github kjd / idna / tests / test_idna.py View on Github external
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
github kjd / idna / tests / test_idna.py View on Github external
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
github kjd / idna / tests / test_idna.py View on Github external
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