diff options
| author | Christian Krinitsin <christian.krinitsin@iqmine.de> | 2025-04-08 10:55:21 +0200 |
|---|---|---|
| committer | Christian Krinitsin <christian.krinitsin@iqmine.de> | 2025-04-08 10:55:21 +0200 |
| commit | 44e38436eadc5320e0b08f649103828213ef465f (patch) | |
| tree | 34e2e63aae343ab5801ed194045b725682484f4f | |
| parent | de990e0f04d6afdc573d30eb9261b12f0300e0ff (diff) | |
| download | testreport-44e38436eadc5320e0b08f649103828213ef465f.tar.gz testreport-44e38436eadc5320e0b08f649103828213ef465f.zip | |
add public interface for parsing data
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | parse_data.py | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore index 5c90153..c5e2afa 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -report.html \ No newline at end of file +report.html +__pycache__ \ No newline at end of file diff --git a/parse_data.py b/parse_data.py new file mode 100644 index 0000000..92fa038 --- /dev/null +++ b/parse_data.py @@ -0,0 +1,24 @@ + +class Category: + failed = False + tests = [] + + def __init__(self, name: str): + self.name = name + + def is_number_in_tests(self, number: int) -> bool: + return self.tests[-1] == number + + def add_test(self, log_type: str, number: int, timestamp: str, description: str, fail_message: str): + # TODO + # adds the test to the tests-list. if the test is a fail, the whole category also fails. + # if the test number is already registered (as a fail), add this fail_message to the messages of that test + pass + +def find_category_in_data(name: str, data: list[Category]) -> int: + # TODO + # returns the index of the category with the same name in data + # return -1, if the category cannot be found + return -1 + +data = [] # List of Category objects \ No newline at end of file |