diff options
author | 2011-08-02 20:12:15 +0200 | |
---|---|---|
committer | 2011-08-02 20:12:15 +0200 | |
commit | e1e9de99067427288827b52c53a8de3871e930ef (patch) | |
tree | 1276fc05e4f2db6b3264f9712e04728681afdb4a /pmstestsuite/library | |
parent | Remove double definition of assertTrue(). (diff) | |
download | pms-test-suite-e1e9de99067427288827b52c53a8de3871e930ef.tar.gz pms-test-suite-e1e9de99067427288827b52c53a8de3871e930ef.tar.bz2 pms-test-suite-e1e9de99067427288827b52c53a8de3871e930ef.zip |
Add .assertEqual()/.assertNotEqual() for the test cases.
Diffstat (limited to 'pmstestsuite/library')
-rw-r--r-- | pmstestsuite/library/case.py | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py index a11bafe..6a37524 100644 --- a/pmstestsuite/library/case.py +++ b/pmstestsuite/library/case.py @@ -154,6 +154,34 @@ class TestCase(ABCObject): if needle not in container: raise AssertionError(msg) + def assertEqual(self, value, expect, msg): + """ + Assert that the value is equal to expected one. + + @param value: the actual value + @type value: any + @param expect: the expected value + @type expect: any + @param msg: assertion description + @type msg: string + """ + if value != expect: + raise AssertionError(msg) + + def assertNotEqual(self, value, unallowed, msg): + """ + Assert that the value is other than an unallowed one. + + @param value: the actual value + @type value: any + @param expect: the unallowed value + @type expect: any + @param msg: assertion description + @type msg: string + """ + if value == unallowed: + raise AssertionError(msg) + @abstractmethod def check_result(self, pm): """ |