From f5c0ff8dd0a5a4634a72fd2db84a6c8dd5582456 Mon Sep 17 00:00:00 2001 From: cindy-x-liang <67083541+cindy-x-liang@users.noreply.github.com> Date: Thu, 2 May 2024 18:01:07 -0400 Subject: [PATCH] commented out stuff that relies on config/test_config.txt --- src/app.py | 2 +- src/main.py | 43 ++++++++++++++++++++++--------------------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/src/app.py b/src/app.py index f4cedde..993ddbd 100644 --- a/src/app.py +++ b/src/app.py @@ -20,7 +20,7 @@ scheduler = BackgroundScheduler() def run_tests_job(): - config = run_tests(["--use-config"]) + config = run_tests() global return_val return_val["CourseGrab"]= config.get("CourseGrab") return_val["Eatery"]= config.get("Eatery") diff --git a/src/main.py b/src/main.py index 8510bac..c26abec 100644 --- a/src/main.py +++ b/src/main.py @@ -25,28 +25,29 @@ def run_tests(args=sys.argv[1:]): elif args[0] == "--local-only": test_config = default_config local_only = True - elif args[0] == "--use-config": - with open(path.join(environ['BASE_DIR'], 'config/test_config.txt'), 'r') as file: - j = file.read() - if not j: - test_config = default_config - else: - try: - test_config = Config(j) - except Exception as e: - print(j) - print(e) + # elif args[0] == "--use-config": + # with open(path.join(environ['BASE_DIR'], 'config/test_config.txt'), 'r') as file: + # j = file.read() + # if not j: + # test_config = default_config + # else: + # try: + # test_config = Config(j) + # except Exception as e: + # print(j) + # print(e) - if len(test_config) != len(test_groups): - test_config = default_config - # test_config is a json of app names mapped to of "OFF", "ON", or "FAILED" - # "OFF" represents a disabled test_group - # "ON" represents an enabled test_group - # "FAILED" represents a test_group that has failed previously and is will have its output suppressed to prevent spam - # Config values of "ON" and "FAILED" will be tested - if "--local-only" in args[1:]: - local_only = True + # if len(test_config) != len(test_groups): + # test_config = default_config + # # test_config is a json of app names mapped to of "OFF", "ON", or "FAILED" + # # "OFF" represents a disabled test_group + # # "ON" represents an enabled test_group + # # "FAILED" represents a test_group that has failed previously and is will have its output suppressed to prevent spam + # # Config values of "ON" and "FAILED" will be tested + # if "--local-only" in args[1:]: + # local_only = True else: + print(args) raise Exception("Invalid args, can use the following: [--use-config] [--local-only]") # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ APPLICATION CODE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ original_config = copy.deepcopy(test_config) @@ -128,4 +129,4 @@ def run_tests(args=sys.argv[1:]): return test_config if __name__ == '__main__': - run_tests(["--use-config"]) \ No newline at end of file + run_tests() \ No newline at end of file