| from collections import OrderedDict |
| self.matches = OrderedDict() |
| def configure(self, instance): |
| config = instance.test.harness_config |
| self.type = config.get('type', None) |
| self.regex = config.get('regex', [] ) |
| self.repeat = config.get('repeat', 1) |
| self.ordered = config.get('ordered', True) |
| if self.type == "one_line": |
| pattern = re.compile(self.regex[0]) |
| elif self.type == "multi_line": |
| if pattern.search(line) and not r in self.matches: |
| if len(self.matches) == len(self.regex): |
| for k,v in self.matches.items(): |
| RUN_PASSED = "PROJECT EXECUTION SUCCESSFUL" |
| RUN_FAILED = "PROJECT EXECUTION FAILED" |
| if self.RUN_PASSED in line: |
| if self.RUN_FAILED in line: |