예제 #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')
예제 #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 ")
예제 #3
0
파일: tests.py 프로젝트: jbspeakr/pymkm
    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':")
예제 #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:')
예제 #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')
예제 #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')
예제 #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')
예제 #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')
예제 #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')
예제 #10
0
def main():
    app = PyMkmApp()
    app.start()