(tree, limit)
| 167 | print('\n'.join(assessed_ignored_seg_but_matched)) |
| 168 | |
| 169 | def parse_segments(tree, limit): |
| 170 | segments = islice(tree.findall('.//Segment'), limit) |
| 171 | for s in segments: |
| 172 | ignored_tag = s.find('Ignored') |
| 173 | ignored = s.find('Ignored') is not None and ignored_tag.text == 'true' |
| 174 | segment_id = int(s.find('.//ReportSegmentID').text) |
| 175 | matched_route = parse_route(s.find('Route')) |
| 176 | # TODO(mgsergio): This is a temproraty hack. All untouched segments |
| 177 | # within limit are considered accurate, so golden path should be equal |
| 178 | # matched path. |
| 179 | golden_route = parse_route(s.find('GoldenRoute')) |
| 180 | if not golden_route and not ignored: |
| 181 | continue |
| 182 | yield Segment(segment_id, golden_route, matched_route, ignored) |
| 183 | |
| 184 | def calculate(tree): |
| 185 | result = {} |
no test coverage detected