| 31 | |
| 32 | |
| 33 | class Marker: |
| 34 | def __init__(self, matches_start_func=None, matches_end_func=None): |
| 35 | self.matches_start = util.default(matches_start_func, lambda line: line == self.start) |
| 36 | self.matches_end = util.default(matches_end_func, lambda line: line == self.end) |
| 37 | |
| 38 | @staticmethod |
| 39 | def from_name(name): |
| 40 | return Marker( |
| 41 | matches_start_func=lambda line: line == f"<!-- Polygraphy Test: {name} Start -->", |
| 42 | matches_end_func=lambda line: line == f"<!-- Polygraphy Test: {name} End -->", |
| 43 | ) |
| 44 | |
| 45 | |
| 46 | VALID_MARKERS = { |
no outgoing calls