Init exception. Args: # expected_methods: A sequence of MockMethod objects that should have been # called. expected_methods: [MockMethod] Raises: ValueError: if expected_methods contains no methods.
(self, expected_methods)
| 77 | """ |
| 78 | |
| 79 | def __init__(self, expected_methods): |
| 80 | """Init exception. |
| 81 | |
| 82 | Args: |
| 83 | # expected_methods: A sequence of MockMethod objects that should have been |
| 84 | # called. |
| 85 | expected_methods: [MockMethod] |
| 86 | |
| 87 | Raises: |
| 88 | ValueError: if expected_methods contains no methods. |
| 89 | """ |
| 90 | |
| 91 | if not expected_methods: |
| 92 | raise ValueError("There must be at least one expected method") |
| 93 | Error.__init__(self) |
| 94 | self._expected_methods = expected_methods |
| 95 | |
| 96 | def __str__(self): |
| 97 | calls = "\n".join(["%3d. %s" % (i, m) |