Exemplo n.º 1
0
 def test_can_specify_custom_failure_exception(self):
     assert_raises(FooError, lambda: assert_falsish(True, failure_exception=FooError))
Exemplo n.º 2
0
 def test_raises_if_value_is_trueish(self):
     assert_raises(AssertionError, lambda: assert_falsish(True))
     assert_raises(AssertionError, lambda: assert_falsish('foo'))
     assert_raises(AssertionError, lambda: assert_falsish(4))
Exemplo n.º 3
0
 def test_can_specify_custom_message(self):
     exception = assert_raises(AssertionError, lambda: assert_falsish(True, message='fnord'))
     assert_equals('fnord', exception_message(exception))
Exemplo n.º 4
0
 def test_accepts_falsish_values(self):
     assert_falsish(False)
     assert_falsish(None)
     assert_falsish('')
Exemplo n.º 5
0
 def test_can_specify_custom_failure_exception(self):
     assert_raises(FooError,
                   lambda: assert_falsish(True, failure_exception=FooError))
Exemplo n.º 6
0
 def test_can_specify_custom_message(self):
     exception = assert_raises(
         AssertionError, lambda: assert_falsish(True, message='fnord'))
     assert_equals('fnord', exception_message(exception))
Exemplo n.º 7
0
 def test_raises_if_value_is_trueish(self):
     assert_raises(AssertionError, lambda: assert_falsish(True))
     assert_raises(AssertionError, lambda: assert_falsish('foo'))
     assert_raises(AssertionError, lambda: assert_falsish(4))
Exemplo n.º 8
0
 def test_accepts_falsish_values(self):
     assert_falsish(False)
     assert_falsish(None)
     assert_falsish('')