<commit_before>"""
Test cases for the pretty printing system.
"""


from holoviews.element.comparison import ComparisonTestCase
from holoviews import Element
from holoviews.core.pprint import PrettyPrinter


class PrettyPrintTest(ComparisonTestCase):

    def setUp(self):
        self.element1 = Element(None, group='Value', label='Label')
        self.element2 = Element(None, group='Value', label='')

    def test_element_repr1(self):
        r = PrettyPrinter.pprint(self.element1)
        self.assertEqual(r, 'Element.Value.Label')

    def test_element_repr2(self):
        r = PrettyPrinter.pprint(self.element2)
        self.assertEqual(r, 'Element.Value')

    def test_overlay_repr1(self):
        # Pointless trailing space...
        expected = 'Overlay.Value\n*--Element.Value.Label\n*--Element.Value      '
        o = self.element1 * self.element2
        r = PrettyPrinter.pprint(o)
        self.assertEqual(r, expected)



<commit_msg>Updated pretty printing unit tests<commit_after>"""
Test cases for the pretty printing system.
"""


from holoviews.element.comparison import ComparisonTestCase
from holoviews import Element
from holoviews.core.pprint import PrettyPrinter


class PrettyPrintTest(ComparisonTestCase):

    def setUp(self):
        self.element1 = Element(None, group='Value', label='Label')
        self.element2 = Element(None, group='Value', label='')

    def test_element_repr1(self):
        r = PrettyPrinter.pprint(self.element1)
        self.assertEqual(r, ':Element')

    def test_overlay_repr1(self):
        # Pointless trailing space...
        expected = ':Overlay\n   Value.Label :Element\n   Value.I     :Element'
        o = self.element1 * self.element2
        r = PrettyPrinter.pprint(o)
        self.assertEqual(r, expected)




{'fraction_non_alphanumeric': 0.1103641456582633, 'fraction_numerical': 0.008963585434173669, 'mean_word_length': 3.3036144578313253, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6478487', 'n_tokens_mistral': 551, 'n_tokens_neox': 530, 'n_words': 118}