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

examples.ExampleWithAssertThat   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 11
Duplicated Lines 0 %
Metric Value
dl 0
loc 11
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A ExampleWithAssertThat.testCanAlsoAssertPlainBooleans() 0 2 1
A ExampleWithAssertThat.testCanAlsoSupplyDescriptiveReason() 0 2 1
A ExampleWithAssertThat.testUsingAssertThat() 0 4 1
1
import sys
2
sys.path.append('..')
3
4
from hamcrest import *
5
import unittest
6
7
8
class ExampleWithAssertThat(unittest.TestCase):
9
    def testUsingAssertThat(self):
10
        assert_that('xx', is_('xx'))
11
        assert_that('yy', is_not('xx'))
12
        assert_that('i like cheese', contains_string('cheese'))
13
14
    def testCanAlsoSupplyDescriptiveReason(self):
15
        assert_that('xx', is_('xx'), 'description')
16
17
    def testCanAlsoAssertPlainBooleans(self):
18
        assert_that(True, 'This had better not fail')
19
20
21
if __name__ == '__main__':
22
    unittest.main()
23