Beispiel #1
0
    def __init__(
        self,
        execution_observer: ExecutionObserver = ObserversFactory.make_stub()):
        super().__init__(execution_observer)
        self._caption = 'Top level'

        self._options = {
            '0':
            make_generator_entry(WriteWidget.caption,
                                 WidgetsFactory.make_write()),
            '1':
            make_generator_entry(NavigationWidget.caption,
                                 WidgetsFactory.make_navigation()),
            '2':
            make_generator_entry(RefactorWidget.caption,
                                 WidgetsFactory.make_refactor()),
            # '3': make_generator_entry(CommonWidget.caption, WidgetsFactory.make_common()),
            '3':
            make_generator_entry(KeypadWidget.caption,
                                 WidgetsFactory.make_keypad()),
        }
 def test_widgets_creation(self):
     self.assertIsInstance(ObserversFactory.make_numeric_keypad(), NumericKeypadExecutionObserver)
     self.assertIsInstance(ObserversFactory.make_function(), FunctionExecutionObserver)
     self.assertIsInstance(ObserversFactory.make_keypad(), KeypadExecutionObserver)
Beispiel #3
0
 def setUp(self):
     self.keypad_widget = KeypadWidget(ObserversFactory.make_stub())
 def make_navigation(observer=ObserversFactory.make_stub()
                     ) -> GeneratorWidget:
     from generator.widgets.navigation import NavigationWidget
     return NavigationWidget(observer)
 def make_common(observer=ObserversFactory.make_stub()) -> GeneratorWidget:
     from generator.widgets.common_gen import CommonWidget
     return CommonWidget(observer)
 def make_keypad(observer=ObserversFactory.make_keypad()
                 ) -> GeneratorWidget:
     from generator.widgets.keypad import KeypadWidget
     return KeypadWidget(observer)
 def make_class(observer=ObserversFactory.make_stub()) -> GeneratorWidget:
     from generator.widgets.class_gen import ClassWidget
     return ClassWidget(observer)
 def make_refactor(observer=ObserversFactory.make_stub()
                   ) -> GeneratorWidget:
     from generator.widgets.refactor import RefactorWidget
     return RefactorWidget(observer)
 def make_write(observer=ObserversFactory.make_stub()) -> GeneratorWidget:
     from generator.widgets.write import WriteWidget
     return WriteWidget(observer)
 def make_function(observer=ObserversFactory.make_function()
                   ) -> GeneratorWidget:
     from generator.widgets.function import FunctionWidget
     return FunctionWidget(observer)
 def make_top_level(observer=ObserversFactory.make_stub()
                    ) -> GeneratorWidget:
     from generator.widgets.top_level import TopLevelWidget
     return TopLevelWidget(observer)
 def make_statement(observer=ObserversFactory.make_stub()
                    ) -> GeneratorWidget:
     from generator.widgets.statement import StatementWidget
     return StatementWidget(observer)
 def make_numeric_keypad(observer=ObserversFactory.make_numeric_keypad()
                         ) -> GeneratorWidget:
     from generator.widgets.numeric_keypad import NumericKeypadWidget
     return NumericKeypadWidget(observer)