def setUpClass(cls):
     super(testNumbers, cls).setUpClass()
     log.getLogger("testNumbers")
     with open("test_logs/numbers_test.log", 'w') as test_file:
         test_file.truncate()
     log.basicConfig(filename='test_logs/numbers_test.log', level=log.DEBUG,
                     format='[%(asctime)s]:%(levelname)s: %(message)s')
     cls.utils = Utils()
Exemplo n.º 2
0
    def setUpClass(cls):
        super(testTrivia, cls).setUpClass()
        log.getLogger("testTrivia")

        # Regex expression, matches parts of your output exactly and the rest loosely.
        cls.question_pattern = ">\*Category: .*<br><br>>\*Question: .*\*"

        with open("test_logs/trivia_test.log", 'w') as test_file:
            test_file.truncate()
        log.basicConfig(filename='test_logs/trivia_test.log',
                        level=log.DEBUG,
                        format='[%(asctime)s]:%(levelname)s: %(message)s')

        cls.path_to_file = "testing_files/trivia_test.json"  # test file location

        cls.utils = Utils()

        with open(cls.path_to_file, 'w') as json_file:
            json.dump({"text": ""}, json_file)