Completed
Pull Request — master (#80)
by
unknown
40s
created

IsAnythingTest   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testAlwaysEvaluatesToTrue() 0 4 1
A testMatchAlwaysSucceedsSoShouldNotGenerateMismatchDescription() 0 2 1
A testHasUsefulDefaultDescription() 0 2 1
A testCanOverrideDescription() 0 3 1
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