Completed
Pull Request — master (#67)
by
unknown
01:24
created

BoolComparisonTest.test_is_true_description()   A

Complexity

Conditions 1

Size

Total Lines 4

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 4
rs 10
1
from hamcrest import assert_that, equal_to
2
from hamcrest.core.string_description import StringDescription
3
from hamcrest.library.bool import is_false, is_true
4
from hamcrest_unit_test.matcher_test import MatcherTest
5
6
7
class BoolComparisonTest(MatcherTest):
8
    def test_true_is_true(self):
9
        self.assert_matches('Is True', is_true(), True)
10
11
    def test_false_is_not_true(self):
12
        self.assert_does_not_match('False', is_true(), False)
13
14
    def test_false_is_false(self):
15
        self.assert_matches('False', is_false(), False)
16
17
    def test_true_is_not_false(self):
18
        self.assert_does_not_match('True', is_false(), True)
19
20
    def test_number_is_not_true(self):
21
        self.assert_does_not_match('True', is_true(), 1)
22
23
    def test_number_is_not_false(self):
24
        self.assert_does_not_match('False', is_false(), 1)
25
26
    def test_is_true_description(self):
27
        description = StringDescription()
28
        is_true().describe_to(description)
29
        assert_that(str(description), equal_to('True'))
30
31
    def test_is_false_description(self):
32
        description = StringDescription()
33
        is_false().describe_to(description)
34
        assert_that(str(description), equal_to('False'))
35