Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/pms-test-suite:master commit in: pmstestsuite/library/
Date: Tue, 02 Aug 2011 18:53:25
Message-Id: e1e9de99067427288827b52c53a8de3871e930ef.mgorny@gentoo
1 commit: e1e9de99067427288827b52c53a8de3871e930ef
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 2 18:12:15 2011 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 2 18:12:15 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/pms-test-suite.git;a=commit;h=e1e9de99
7
8 Add .assertEqual()/.assertNotEqual() for the test cases.
9
10 ---
11 pmstestsuite/library/case.py | 28 ++++++++++++++++++++++++++++
12 1 files changed, 28 insertions(+), 0 deletions(-)
13
14 diff --git a/pmstestsuite/library/case.py b/pmstestsuite/library/case.py
15 index a11bafe..6a37524 100644
16 --- a/pmstestsuite/library/case.py
17 +++ b/pmstestsuite/library/case.py
18 @@ -154,6 +154,34 @@ class TestCase(ABCObject):
19 if needle not in container:
20 raise AssertionError(msg)
21
22 + def assertEqual(self, value, expect, msg):
23 + """
24 + Assert that the value is equal to expected one.
25 +
26 + @param value: the actual value
27 + @type value: any
28 + @param expect: the expected value
29 + @type expect: any
30 + @param msg: assertion description
31 + @type msg: string
32 + """
33 + if value != expect:
34 + raise AssertionError(msg)
35 +
36 + def assertNotEqual(self, value, unallowed, msg):
37 + """
38 + Assert that the value is other than an unallowed one.
39 +
40 + @param value: the actual value
41 + @type value: any
42 + @param expect: the unallowed value
43 + @type expect: any
44 + @param msg: assertion description
45 + @type msg: string
46 + """
47 + if value == unallowed:
48 + raise AssertionError(msg)
49 +
50 @abstractmethod
51 def check_result(self, pm):
52 """