示例#1
0
    def test_attribute(self):
        class TestClass:
            pass

        test_obj = TestClass()
        test_obj.att = 10
        verify(test_obj).attribute('att').equals(10)
示例#2
0
 def test_is_zero(self):
     verify(0).is_zero()
示例#3
0
 def test_length_equal_broken_not_int(self):
     with self.assertRaises(TestBrokenException):
         verify([1]).size.equal_to_length_of(2)
示例#4
0
 def test_length_equal_failed(self):
     with self.assertRaises(AssertionError):
         verify([]).size.equals(1)
示例#5
0
 def test_greater_than_broken(self):
     with self.assertRaises(TestBrokenException):
         verify(2).greater_than('1')
示例#6
0
 def test_is_a_ok(self):
     verify(1).same_as(1)
     verify('a').same_as('a')
     a_l = []
     verify(a_l).same_as(a_l)
示例#7
0
 def test_less_than_broken(self):
     with self.assertRaises(TestBrokenException):
         verify(2).less_than('1')
示例#8
0
 def test_less_than(self):
     verify(1).less_than(2)
示例#9
0
 def test_type_is_failed(self):
     with self.assertRaises(AssertionError):
         verify('text').type_is(list)
示例#10
0
 def test_type_is(self):
     verify([1, 2]).type_is(list)
     verify('text').type_is(str)
示例#11
0
 def test_attribute_failed(self):
     with self.assertRaises(AssertionError):
         verify('text').attribute('x').equals(10)
示例#12
0
 def test_is_negative(self):
     verify(-1).is_negative()
示例#13
0
 def test_is_positive_list(self):
     verify([1, 2]).is_positive()
示例#14
0
 def test_is_positive(self):
     verify(1).is_positive()
示例#15
0
 def test_not_equal(self):
     verify(1).not_equals(2)
示例#16
0
 def test_length_less_or_equal_eq(self):
     verify(1).less_or_equal_to(1)
示例#17
0
 def test_not_equal_failed(self):
     with self.assertRaises(AssertionError):
         verify(1).not_equals(1)
示例#18
0
 def test_length_less_or_equal_failed(self):
     with self.assertRaises(AssertionError):
         verify(1).less_or_equal_to(0)
示例#19
0
 def test_less_than_failed(self):
     with self.assertRaises(AssertionError):
         verify(2).less_than(1)
示例#20
0
 def test_length_greater_or_equal_eq(self):
     verify(1).greater_or_equal_to(1)
示例#21
0
 def test_greater_than(self):
     verify(1).greater_than(0)
示例#22
0
 def test_is_not_none(self):
     verify(1).is_not_none()
示例#23
0
 def test_greater_than_failed_if_equal(self):
     with self.assertRaises(AssertionError):
         verify(2).greater_than(2)
示例#24
0
 def test_length_greater_or_equal_failed(self):
     with self.assertRaises(AssertionError):
         verify(1).greater_or_equal_to(2)
示例#25
0
 def test_length_equal(self):
     verify([]).size.equals(0)
示例#26
0
 def test_is_not_none_failed(self):
     with self.assertRaises(AssertionError):
         verify(None).is_not_none()
示例#27
0
 def test_length_equal_broken(self):
     with self.assertRaises(TestBrokenException):
         verify(2).size.equals(2)
示例#28
0
 def test_equal(self):
     verify(1).equals(1)
示例#29
0
 def test_length_equal_to_length_of(self):
     verify([1]).size.equal_to_length_of([2])
示例#30
0
 def test_is_not_empty(self):
     verify([1, 2]).is_not_empty()