To start us off, I think this can consist of a basic loop using the TraceFileParser to get one line from the file at a time and use something like a match statement to determine which actions to perform for each event. For now, each case can just have a pass statement or other placeholder.
To make this more easily testable, we may want to put the match in a separate function from the main program. This would allow us to call it directly in a testing context where we provide a single event at a time to the function without opening a file and parsing it. This function could return a dictionary with some representation of the statistics related to the action, for example:
To start us off, I think this can consist of a basic loop using the
TraceFileParser
to get one line from the file at a time and use something like amatch
statement to determine which actions to perform for each event. For now, eachcase
can just have apass
statement or other placeholder.To make this more easily testable, we may want to put the
match
in a separate function from the main program. This would allow us to call it directly in a testing context where we provide a single event at a time to the function without opening a file and parsing it. This function could return a dictionary with some representation of the statistics related to the action, for example:This output could also then be tested.