Completed
Pull Request — master (#71)
by
unknown
01:30
created

IsAnythingTest.testHasUsefulDefaultDescription()   A

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
dl 0
loc 2
rs 10
1
if __name__ == "__main__":
2
    import sys
3
    sys.path.insert(0, '..')
4
    sys.path.insert(0, '../..')
5
6
from hamcrest.core.core.isanything import *
7
8
from hamcrest_unit_test.matcher_test import MatcherTest
9
import unittest
10
11
__author__ = "Jon Reid"
12
__copyright__ = "Copyright 2011 hamcrest.org"
13
__license__ = "BSD, see License.txt"
14
15
16
class IsAnythingTest(MatcherTest):
17
18
    def testAlwaysEvaluatesToTrue(self):
19
        self.assert_matches('None', anything(), None)
20
        self.assert_matches('object', anything(), object())
21
        self.assert_matches('string', anything(), 'hi')
22
23
    def testHasUsefulDefaultDescription(self):
24
        self.assert_description('ANYTHING', anything())
25
26
    def testCanOverrideDescription(self):
27
        description = 'DESCRIPTION'
28
        self.assert_description(description, anything(description))
29
30
    def testMatchAlwaysSucceedsSoShouldNotGenerateMismatchDescription(self):
31
        self.assert_no_mismatch_description(anything(), 'hi')
32
33
34
if __name__ == "__main__":
35
    unittest.main()
36