def test_slices_in_y_attribute_is_working_properly(self): """testing if the slices_in_y attribute is properly working """ test_value = 1001 rs = RenderSlicer(camera=self.camera) self.assertNotEqual(rs.slices_in_y, test_value) rs.slices_in_y = test_value self.assertEqual(rs.slices_in_y, test_value)
def test_slices_in_y_attribute_is_working_properly(self): """testing if the slices_in_y attribute is properly working """ test_value = 1001 rs = RenderSlicer(camera=self.camera) self.assertNotEqual(rs.slices_in_y, test_value) rs.slices_in_y = test_value self.assertEqual(rs.slices_in_y, test_value)
def test_slices_in_y_attribute_is_smaller_than_1(self): """testing if a ValueError will be raised when the slices_in_y attribute is set to a value smaller than 1 """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(ValueError) as cm: rs.slices_in_y = 0 self.assertEqual( str(cm.exception), 'RenderSlicer.slices_in_y should be a non-zero positive integer')
def test_slices_in_y_attribute_is_smaller_than_1(self): """testing if a ValueError will be raised when the slices_in_y attribute is set to a value smaller than 1 """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(ValueError) as cm: rs.slices_in_y = 0 self.assertEqual( str(cm.exception), 'RenderSlicer.slices_in_y should be a non-zero positive integer' )
def test_slices_in_y_attribute_is_set_to_None(self): """testing if a TypeError will be raised when the slices_in_y attribute is set to None """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(TypeError) as cm: rs.slices_in_y = None self.assertEqual( str(cm.exception), "RenderSlicer.slices_in_y should be a non-zero positive integer, " "not NoneType")
def test_slices_in_y_attribute_is_set_to_a_value_other_than_an_integer(self): """testing if a TypeError will be tested if the slices_in_y attribute is set to a value other than an integer """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(TypeError) as cm: rs.slices_in_y = 'not an integer' self.assertEqual( str(cm.exception), 'RenderSlicer.slices_in_y should be a non-zero positive integer, ' 'not str' )
def test_slices_in_y_attribute_is_set_to_a_value_other_than_an_integer(self): """testing if a TypeError will be tested if the slices_in_y attribute is set to a value other than an integer """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(TypeError) as cm: rs.slices_in_y = 'not an integer' self.assertEqual( str(cm.exception), 'RenderSlicer.slices_in_y should be a non-zero positive integer, ' 'not str' )
def test_slices_in_y_attribute_is_set_to_None(self): """testing if a TypeError will be raised when the slices_in_y attribute is set to None """ rs = RenderSlicer(camera=self.camera) with self.assertRaises(TypeError) as cm: rs.slices_in_y = None self.assertEqual( str(cm.exception), "RenderSlicer.slices_in_y should be a non-zero positive integer, " "not NoneType" )