| 374 | self.__dict__.update(kwargs) |
| 375 | |
| 376 | def __eq__(self, other): |
| 377 | if len(self.__dict__) != len(other.__dict__): |
| 378 | return |
| 379 | for k, v in self.__dict__.items(): |
| 380 | if k in self.IGNORE_KEYS: |
| 381 | continue |
| 382 | if k not in other.__dict__: |
| 383 | return |
| 384 | if k in self.FILE_KEYS: |
| 385 | if v and other.__dict__[k]: |
| 386 | try: |
| 387 | with open(v) as f1, open(other.__dict__[k]) as f2: |
| 388 | if f1.read() != f2.read(): |
| 389 | return |
| 390 | except OSError: |
| 391 | # fall back to only compare filenames in case we are |
| 392 | # testing the passing of filenames to the config |
| 393 | if other.__dict__[k] != v: |
| 394 | return |
| 395 | else: |
| 396 | if other.__dict__[k] != v: |
| 397 | return |
| 398 | else: |
| 399 | if other.__dict__[k] != v: |
| 400 | return |
| 401 | return True |
| 402 | |
| 403 | def __repr__(self): |
| 404 | rep = "\n" |