about summary refs log tree commit diff stats
path: root/parse_data.py
blob: 92fa0383f034cd20a572e12dc0374aa9be1c53bc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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