Ejemplo n.º 1
0
    def test_menu_option_9_1_match(self, mock_open, mock_stdout, *args):
        app = PyMkmApp(self.config)

        with self.assertLogs(level='DEBUG') as cm:
            app.start()
            log_record = cm.records[len(cm.records) - 1]
            self.assertRegex(log_record.message, r'>> Exited import_from_csv')
Ejemplo n.º 2
0
    def test_menu_option_6(self, mock_stdout, *args):

        app = PyMkmApp(self.config)
        app.start()
        print(mock_stdout.getvalue())
        self.assertRegex(mock_stdout.getvalue(),
                         r"This will show items in your ")
Ejemplo n.º 3
0
    def test_menu_option_5(self, mock_stdout, *args):

        app = PyMkmApp(self.config)
        app.start()
        print(mock_stdout.getvalue())
        self.assertRegex(mock_stdout.getvalue(),
                         r"{'account':")
Ejemplo n.º 4
0
    def test_menu_option_5(self, mock_stdout, *args):

        app = PyMkmApp(self.config)
        app.start()
        text = mock_stdout.getvalue()
        self.assertRegex(mock_stdout.getvalue(),
                         r'Top 20 most expensive articles in stock:')
Ejemplo n.º 5
0
    def test_menu_option_8(self, *args):
        app = PyMkmApp(self.config)

        with self.assertLogs(level='DEBUG') as cm:
            app.start()
            log_record = cm.records[len(cm.records) - 1]
            self.assertRegex(log_record.message,
                             r'>> Exited clear_entire_stock')
Ejemplo n.º 6
0
    def test_menu_option_4(self, mock_stdout, *args):

        app = PyMkmApp(self.config)
        with self.assertLogs(level='DEBUG') as cm:
            app.start()
            log_record = cm.records[len(cm.records) - 1]
            self.assertRegex(log_record.message,
                             r'>> Exited find_deals_from_user')
Ejemplo n.º 7
0
    def test_menu_option_3(self, mock_stdout, *args):

        app = PyMkmApp(self.config)
        with self.assertLogs(level='DEBUG') as cm:
            app.start()
            log_record = cm.records[len(cm.records) - 1]
            self.assertRegex(log_record.message,
                             r'>> Exited list_competition_for_product')
Ejemplo n.º 8
0
    def test_menu_option_2(self, mock_open, mock_stdout, *args):
        app = PyMkmApp(self.config)

        with self.assertLogs(level='DEBUG') as cm:
            app.start()
            log_record = cm.records[len(cm.records) - 1]
            self.assertRegex(log_record.message,
                             r'>> Exited update_product_to_trend')
Ejemplo n.º 9
0
 def test_main_menu(self, mock_input, mock_stdout, *args):
     app = PyMkmApp(self.config)
     app.start()
     self.assertRegex(mock_stdout.getvalue(), r'╭─── PyMKM')
Ejemplo n.º 10
0
def main():
    app = PyMkmApp()
    app.start()