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

BoolComparisonTest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 28
rs 10
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A test_false_is_not_true() 0 2 1
A test_is_false_description() 0 4 1
A test_true_is_not_false() 0 2 1
A test_true_is_true() 0 2 1
A test_false_is_false() 0 2 1
A test_number_is_not_false() 0 2 1
A test_number_is_not_true() 0 2 1
A test_is_true_description() 0 4 1
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