Esempio n. 1
0
 def test_height_setter(self):
     bbox = BBox(1, 2, right=3, height=4)
     bbox.height = 9
     assert bbox.bottom == 11
Esempio n. 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)
Esempio n. 3
0
 def test_height_getter(self):
     assert BBox(1, 2, right=7, bottom=11).height == 9
Esempio n. 4
0
 def test_width_setter(self):
     bbox = BBox(1, 2, right=3, bottom=4)
     bbox.width = 6
     assert bbox.right == 7
Esempio n. 5
0
 def test_width_getter(self):
     assert BBox(1, 2, right=7, bottom=11).width == 6
Esempio n. 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)
Esempio n. 7
0
 def test_error_on_neither_bottom_or_height_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, right=3)
Esempio n. 8
0
 def test_error_on_neither_right_or_width_passed(self):
     with pytest.raises(ValueError) as excinfo:
         BBox(1, 2, bottom=3)
Esempio n. 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)