testSuccessfulMatchDoesNotGenerateMismatchDescription()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
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.isnone 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 IsNoneTest(MatcherTest):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
17
18
    def testEvaluatesToTrueIfArgumentIsNone(self):
19
        self.assert_matches('None', none(), None)
20
21
    def testEvaluatesToFalseIfArgumentIsNotNone(self):
22
        self.assert_does_not_match('not None', none(), object())
23
24
    def testHasAReadableDescription(self):
25
        self.assert_description('None', none());
26
27
    def testSuccessfulMatchDoesNotGenerateMismatchDescription(self):
28
        self.assert_no_mismatch_description(none(), None)
29
30
    def testMismatchDescriptionShowsActualArgument(self):
31
        self.assert_mismatch_description("was 'bad'", none(), 'bad')
32
33
    def testDescribeMismatch(self):
34
        self.assert_describe_mismatch("was 'bad'", none(), 'bad')
35
36
37
class NotNoneTest(MatcherTest):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38
39
    def testEvaluatesToTrueIfArgumentIsNotNone(self):
40
        self.assert_matches('not None', not_none(), object())
41
42
    def testEvaluatesToFalseIfArgumentIsNone(self):
43
        self.assert_does_not_match('None', not_none(), None)
44
45
    def testHasAReadableDescription(self):
46
        self.assert_description('not None', not_none());
47
48
    def testSuccessfulMatchDoesNotGenerateMismatchDescription(self):
49
        self.assert_no_mismatch_description(not_none(), 'hi')
50
51
    def testMismatchDescriptionShowsActualArgument(self):
52
        self.assert_mismatch_description("was <None>", not_none(), None)
53
54
    def testDescribeMismatch(self):
55
        self.assert_describe_mismatch("was <None>", not_none(), None)
56
57
58
if __name__ == '__main__':
59
    unittest.main()
60