Beispiel #1
0
 def test_fails_for_equal_values(self):
     with assert_raises_assertion("Expected 'apple' != 'apple'"):
         expect('apple').not_equal('apple')
Beispiel #2
0
 def test_fails_for_unequal_values(self):
     with assert_raises_assertion("Expected 'apple' == 'orange'"):
         expect('apple').equal('orange')
Beispiel #3
0
 def test_passes_for_unequal_values(self):
     expect('apple').not_equal('orange')
Beispiel #4
0
 def test_fails_for_equal_values(self):
     with assert_raises_assertion(
             'Expected 1.0000001 not almost equal to 1.00000014 (7)'):
         expect(1.0000001).not_almost_equal(1.00000014)
Beispiel #5
0
 def test_passes_for_equal_values(self):
     expect('apple').equal('apple')
Beispiel #6
0
 def test_passes_for_different_values(self):
     expect(False).is_not(True)
Beispiel #7
0
 def test_passes_for_equal_value(self):
     expect(10).less_equal(10)
Beispiel #8
0
 def test_passes_for_equal_values(self):
     expect(1.0000001).almost_equal(1.00000014)
     expect(1.0000001).almost_equal(1.00000006)
Beispiel #9
0
 def test_fails_for_unequal_values(self):
     with assert_raises_assertion(
             'Expected 1.0000001 almost equal to 1.00000016 (7)'):
         expect(1.0000001).almost_equal(1.00000016)
Beispiel #10
0
 def test_passes_for_equal_value(self):
     expect(10).greater_equal(10)
Beispiel #11
0
 def test_fails_for_larger_value(self):
     with assert_raises_assertion('Expected 10 >= 11'):
         expect(10).greater_equal(11)
Beispiel #12
0
 def test_takes_one_argument(self):
     expect(None)
Beispiel #13
0
 def test_passes_for_smaller_value(self):
     expect(10).greater(9)
Beispiel #14
0
 def test_fails_for_smaller_value(self):
     with assert_raises_assertion('Expected 10 <= 9'):
         expect(10).less_equal(9)
Beispiel #15
0
 def test_passes_for_same_values(self):
     expect(False).is_(False)
Beispiel #16
0
 def test_passes_for_unequal_values(self):
     expect(1.0000001).not_almost_equal(1.00000016)
Beispiel #17
0
 def test_fails_for_different_values(self):
     with assert_raises_assertion('Expected False is True'):
         expect(False).is_(True)
Beispiel #18
0
 def test_does_not_allow_zero_arguments(self):
     with assert_raises(TypeError):
         expect()
Beispiel #19
0
 def test_fails_for_same_values(self):
     with assert_raises_assertion('Expected False is not False'):
         expect(False).is_not(False)
Beispiel #20
0
 def test_passes_for_larger_value(self):
     expect(10).less_equal(11)