예제 #1
0
 def test_height_setter(self):
     bbox = BBox(1, 2, right=3, height=4)
     bbox.height = 9
     assert bbox.bottom == 11
예제 #2
0
 def test_error_on_both_right_and_with_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, right=3, width=4, bottom=5)
예제 #3
0
 def test_height_getter(self):
     assert BBox(1, 2, right=7, bottom=11).height == 9
예제 #4
0
 def test_width_setter(self):
     bbox = BBox(1, 2, right=3, bottom=4)
     bbox.width = 6
     assert bbox.right == 7
예제 #5
0
 def test_width_getter(self):
     assert BBox(1, 2, right=7, bottom=11).width == 6
예제 #6
0
 def test_valid_initalization(self):
     BBox(1, 2, right=3, bottom=4)
     BBox(1, 2, right=3, height=4)
     BBox(1, 2, width=3, bottom=4)
     BBox(1, 2, width=3, height=4)
예제 #7
0
 def test_error_on_neither_bottom_or_height_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, right=3)
예제 #8
0
 def test_error_on_neither_right_or_width_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, bottom=3)
예제 #9
0
 def test_error_on_both_bottom_and_height_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, right=3, bottom=4, height=5)