A single rule that specifies the expected outcome for a single test.
| 1313 | |
| 1314 | |
| 1315 | class Rule(object): |
| 1316 | """A single rule that specifies the expected outcome for a single |
| 1317 | test.""" |
| 1318 | |
| 1319 | def __init__(self, raw_path, path, value): |
| 1320 | self.raw_path = raw_path |
| 1321 | self.path = path |
| 1322 | self.value = value |
| 1323 | |
| 1324 | def GetOutcomes(self, env, defs): |
| 1325 | return self.value.GetOutcomes(env, defs) |
| 1326 | |
| 1327 | def Contains(self, path): |
| 1328 | if len(self.path) > len(path): |
| 1329 | return False |
| 1330 | for i in range(len(self.path)): |
| 1331 | if not self.path[i].match(path[i]): |
| 1332 | return False |
| 1333 | return True |
| 1334 | |
| 1335 | |
| 1336 | HEADER_PATTERN = re.compile(r'\[([^]]+)\]') |
no outgoing calls
searching dependent graphs…