Ejemplo n.º 1
0
    def test_with_bad_category(self):
        """Test property with bad category."""

        with self.assertRaises(ValueError) as e:
            uniprops.get_unicode_property('^alphabetic', 'bad')

        self.assertTrue(str(e), 'Invalid Unicode property!')
Ejemplo n.º 2
0
    def test_bad_property_with_category(self):
        """Test bad property with category."""

        with self.assertRaises(ValueError) as e:
            uniprops.get_unicode_property('^bad', 'binary')

        self.assertTrue(str(e), 'Invalid Unicode property!')
Ejemplo n.º 3
0
    def test_inbad_property(self):
        """Test `isbad` property."""

        with self.assertRaises(ValueError) as e:
            uniprops.get_unicode_property('^inbad')

        self.assertTrue(str(e), 'Invalid Unicode property!')
Ejemplo n.º 4
0
    def test_inverse_vertical_orientation(self):
        """Test inverse `vertical orientation` Category."""

        if PY37:
            result = uniprops.get_unicode_property('^u', 'vo')
            self.assertEqual(
                result, uniprops.unidata.unicode_vertical_orientation['^u'])
        else:
            with self.assertRaises(ValueError) as e:
                uniprops.get_unicode_property('^u', 'vo')

            self.assertTrue(str(e), 'Invalid Unicode property!')
Ejemplo n.º 5
0
    def test_inverse_graphemeclusterbreak(self):
        """Test inverse `grapheme` cluster break Category."""

        result = uniprops.get_unicode_property('^control', 'gcb')
        self.assertEqual(
            result,
            uniprops.unidata.unicode_grapheme_cluster_break['^control'])
Ejemplo n.º 6
0
    def test_in_block(self):
        """Test `inblock` Category."""

        result = uniprops.get_unicode_property('inbasiclatin')
        self.assertEqual(result, uniprops.unidata.unicode_blocks['basiclatin'])
Ejemplo n.º 7
0
    def test_inverse_script(self):
        """Test inverse `script` Category."""

        result = uniprops.get_unicode_property('^latin', 'sc')
        self.assertEqual(result, uniprops.unidata.unicode_scripts['^latin'])
Ejemplo n.º 8
0
    def test_inverse_script_simple(self):
        """Test inverse script simple Category."""

        result = uniprops.get_unicode_property('^latin')
        self.assertEqual(result,
                         uniprops.unidata.unicode_script_extensions['^latin'])
Ejemplo n.º 9
0
    def test_inverse_is_binary(self):
        """Test inverse `isbinary` Category."""

        result = uniprops.get_unicode_property('^isalphabetic')
        self.assertEqual(result,
                         uniprops.unidata.unicode_binary['^alphabetic'])
Ejemplo n.º 10
0
    def test_inverse_joininggroup(self):
        """Test inverse `joining group` Category."""

        result = uniprops.get_unicode_property('^e', 'jg')
        self.assertEqual(result, uniprops.unidata.unicode_joining_group['^e'])
Ejemplo n.º 11
0
    def test_inverse_numerictype(self):
        """Test inverse `numeric type` Category."""

        result = uniprops.get_unicode_property('^decimal', 'nt')
        self.assertEqual(result,
                         uniprops.unidata.unicode_numeric_type['^decimal'])
Ejemplo n.º 12
0
    def test_inverse_binary_simple(self):
        """Test inverse binary simple Category."""

        result = uniprops.get_unicode_property('^alphabetic')
        self.assertEqual(result,
                         uniprops.unidata.unicode_binary['^alphabetic'])
Ejemplo n.º 13
0
    def test_inverse_nfkdquickcheck(self):
        """Test inverse `nfkd` quick check Category."""

        result = uniprops.get_unicode_property('^y', 'nfkdqc')
        self.assertEqual(result,
                         uniprops.unidata.unicode_nfkd_quick_check['^y'])
Ejemplo n.º 14
0
    def test_nfdquickcheck(self):
        """Test `nfd` quick check Category."""

        result = uniprops.get_unicode_property('y', 'nfdqc')
        self.assertEqual(result, uniprops.unidata.unicode_nfd_quick_check['y'])
Ejemplo n.º 15
0
    def test_inverse_block(self):
        """Test inverse `Block` Category."""

        result = uniprops.get_unicode_property('^basiclatin', 'blk')
        self.assertEqual(result,
                         uniprops.unidata.unicode_blocks['^basiclatin'])
Ejemplo n.º 16
0
    def test_inverse_wordbreak(self):
        """Test inverse `word break` Category."""

        result = uniprops.get_unicode_property('^lf', 'wb')
        self.assertEqual(result, uniprops.unidata.unicode_word_break['^lf'])
Ejemplo n.º 17
0
    def test_inverse_sentencebreak(self):
        """Test inverse `sentence` break Category."""

        result = uniprops.get_unicode_property('^cr', 'sb')
        self.assertEqual(result,
                         uniprops.unidata.unicode_sentence_break['^cr'])
Ejemplo n.º 18
0
    def test_inverse_linebreak(self):
        """Test inverse `line break` Category."""

        result = uniprops.get_unicode_property('^jl', 'lb')
        self.assertEqual(result, uniprops.unidata.unicode_line_break['^jl'])
Ejemplo n.º 19
0
    def test_inverse_block_simple(self):
        """Test inverse block simple Category."""

        result = uniprops.get_unicode_property('^basiclatin')
        self.assertEqual(result,
                         uniprops.unidata.unicode_blocks['^basiclatin'])
Ejemplo n.º 20
0
    def test_inverse_script_extensions(self):
        """Test inverse `script extensions` Category."""

        result = uniprops.get_unicode_property('^kana', 'scx')
        self.assertEqual(
            result, uniprops.unidata.unicode_script_extensions['^katakana'])
Ejemplo n.º 21
0
    def test_binary(self):
        """Test binary Category."""

        result = uniprops.get_unicode_property('alphabetic', 'binary')
        self.assertEqual(result, uniprops.unidata.unicode_binary['alphabetic'])
Ejemplo n.º 22
0
    def test_inverse_bidi_paired_bracket_type(self):
        """Test inverse `bidi paired bracket type` Category."""

        result = uniprops.get_unicode_property('^o', 'bpt')
        self.assertEqual(
            result, uniprops.unidata.unicode_bidi_paired_bracket_type['^o'])
Ejemplo n.º 23
0
    def test_inverse_numericvalue(self):
        """Test inverse `numeric value` Category."""

        result = uniprops.get_unicode_property('^1/10', 'nv')
        self.assertEqual(result,
                         uniprops.unidata.unicode_numeric_values['^1/10'])
Ejemplo n.º 24
0
    def test_inverse_age(self):
        """Test inverse `age` Category."""

        result = uniprops.get_unicode_property('^5.0', 'age')
        self.assertEqual(result, uniprops.unidata.unicode_age['^5.0'])
Ejemplo n.º 25
0
    def test_inverse_gc_simple(self):
        """Test inverse `gc` simple Category."""

        result = uniprops.get_unicode_property('^lu')
        self.assertEqual(result,
                         uniprops.unidata.unicode_properties['l']['^u'])
Ejemplo n.º 26
0
    def test_inverse_joiningtype(self):
        """Test inverse `joining type` Category."""

        result = uniprops.get_unicode_property('^c', 'jt')
        self.assertEqual(result, uniprops.unidata.unicode_joining_type['^c'])
Ejemplo n.º 27
0
    def test_inverse_bidi(self):
        """Test inverse `bidi class` Category."""

        result = uniprops.get_unicode_property('^en', 'bc')
        self.assertEqual(result, uniprops.unidata.unicode_bidi_classes['^en'])
Ejemplo n.º 28
0
    def test_inverse_is_script(self):
        """Test inverse `isscript` Category."""

        result = uniprops.get_unicode_property('^islatin')
        self.assertEqual(result,
                         uniprops.unidata.unicode_script_extensions['^latin'])
Ejemplo n.º 29
0
    def test_inverse_decompostion(self):
        """Test inverse `decomposition type` Category."""

        result = uniprops.get_unicode_property('^small', 'dt')
        self.assertEqual(result,
                         uniprops.unidata.unicode_decomposition_type['^small'])
Ejemplo n.º 30
0
    def test_inverse_hangulsyllabletype(self):
        """Test inverse `hangul syllable type` Category."""

        result = uniprops.get_unicode_property('^l', 'hst')
        self.assertEqual(result,
                         uniprops.unidata.unicode_hangul_syllable_type['^l'])