Last active
February 17, 2020 14:25
-
-
Save ppmx/9eb46e23f5e1e91a245c0a7da2907bc2 to your computer and use it in GitHub Desktop.
Example for a Test Adapter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MathClass: | |
| def sqrt(self, x): | |
| import math | |
| return math.sqrt(x) | |
| class TestAdapterMathClass(MathClass): | |
| def sqrt(self, x): | |
| self.assert (x >= 0) | |
| ret = super().sqrt(x) | |
| self.assert (ret * ret == x) | |
| return ret | |
| def assert(self, cond): | |
| # using python's assert() is just an example. | |
| # maybe: if not cond: write_something_to_log() | |
| assert(cond) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment