Example #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!')
Example #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!')
Example #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!')
Example #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!')
Example #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'])
Example #6
0
    def test_in_block(self):
        """Test `inblock` Category."""

        result = uniprops.get_unicode_property('inbasiclatin')
        self.assertEqual(result, uniprops.unidata.unicode_blocks['basiclatin'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #21
0
    def test_binary(self):
        """Test binary Category."""

        result = uniprops.get_unicode_property('alphabetic', 'binary')
        self.assertEqual(result, uniprops.unidata.unicode_binary['alphabetic'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])
Example #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'])