| Total Complexity | 12 |
| Total Lines | 27 |
| Duplicated Lines | 0 % |
| 1 | |||
| 3 | class Diff(object): |
||
| 4 | |||
| 5 | def __init__(self, file1, file2): |
||
| 6 | self.diffDict = {} |
||
| 7 | self.ignore = ['_id'] |
||
| 8 | prov1 = file1.getProvenance() |
||
| 9 | prov2 = file2.getProvenance() |
||
| 10 | for k in set(prov1.keys()).difference(prov2.keys()): |
||
| 11 | if k not in self.ignore: |
||
| 12 | self.diffDict[k] = 'missingIn2' |
||
| 13 | for k in set(prov2.keys()).difference(prov1.keys()): |
||
| 14 | if k not in self.ignore: |
||
| 15 | self.diffDict[k] = 'missingIn1' |
||
| 16 | for k in set(prov1.keys()).intersection(prov2.keys()): |
||
| 17 | if k not in self.ignore: |
||
| 18 | if prov1[k] != prov2[k]: |
||
| 19 | self.diffDict[k] = 'value' |
||
| 20 | |||
| 21 | def areEqual(self): |
||
| 22 | return len(self.diffDict) == 0 |
||
| 23 | |||
| 24 | def assertEqual(self): |
||
| 25 | if not self.areEqual(): |
||
| 26 | raise AssertionError() |
||
| 27 | |||
| 28 | def assertEqualProtocol(self): |
||
| 29 | pass |
||
| 30 |