<commit_before>from mpfmc.tests.MpfMcTestCase import MpfMcTestCase


class TestText(MpfMcTestCase):
    def get_machine_path(self):
        return 'tests/machine_files/text_input'

    def get_config_file(self):
        return 'text_input.yaml'

    def test_text_input(self):
        self.mc.events.post('slide1')
        self.advance_time()

        text_input_widget = (
            self.mc.targets['default'].current_slide.widgets[1])

        text_display_widget = (
            self.mc.targets['default'].current_slide.widgets[2])

        self.assertEqual(text_display_widget.text, '')
        self.assertEqual(text_input_widget.text, 'C')
        self.advance_time()

        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'B')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'A')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'END')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'BACK')

        # should not crash if we go back with no chars
        self.mc.events.post('sw_start')
        self.advance_time()<commit_msg>Increase test time<commit_after>from mpfmc.tests.MpfMcTestCase import MpfMcTestCase


class TestText(MpfMcTestCase):
    def get_machine_path(self):
        return 'tests/machine_files/text_input'

    def get_config_file(self):
        return 'text_input.yaml'

    def test_text_input(self):
        self.mc.events.post('slide1')
        self.advance_time(0.2)

        text_input_widget = (
            self.mc.targets['default'].current_slide.widgets[1])

        text_display_widget = (
            self.mc.targets['default'].current_slide.widgets[2])

        self.assertEqual(text_display_widget.text, '')
        self.assertEqual(text_input_widget.text, 'C')
        self.advance_time()

        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'B')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'A')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'END')
        self.mc.events.post('sw_left_flipper')
        self.advance_time()
        self.assertEqual(text_input_widget.text, 'BACK')

        # should not crash if we go back with no chars
        self.mc.events.post('sw_start')
        self.advance_time()
{'fraction_non_alphanumeric': 0.11714071856287425, 'fraction_numerical': 0.0029940119760479044, 'mean_word_length': 2.8405172413793105, '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': '493817', 'n_tokens_mistral': 869, 'n_tokens_neox': 849, 'n_words': 109}