def test_cost_attribute_is_zero(self): """testing if it is totally ok to test the cost attribute to 0 """ g = Good(**self.kwargs) self.assertNotEqual(g.cost, 0.0) g.cost = 0.0 self.assertEqual(g.cost, 0.0)
def test_cost_attribute_is_zero(self): """testing if it is totally ok to test the cost attribute to 0 """ g = Good(**self.kwargs) assert g.cost != 0.0 g.cost = 0.0 assert g.cost == 0.0
def test_cost_attribute_is_None(self): """testing if the cost attribute will be 0.0 if it is set to None """ g = Good(**self.kwargs) assert g.cost != 0 g.cost = None assert g.cost == 0
def test_cost_attribute_is_None(self): """testing if the cost attribute will be 0.0 if it is set to None """ g = Good(**self.kwargs) self.assertNotEqual(g.cost, 0) g.cost = None self.assertEqual(g.cost, 0)
def test_cost_attribute_is_working_properly(self): """testing if the cost attribute value can be properly changed """ test_value = 145 g = Good(**self.kwargs) self.assertNotEqual(g.cost, test_value) g.cost = test_value self.assertEqual(g.cost, test_value)
def test_cost_attribute_is_working_properly(self): """testing if the cost attribute value can be properly changed """ test_value = 145 g = Good(**self.kwargs) assert g.cost != test_value g.cost = test_value assert g.cost == test_value
def test_cost_attribute_is_negative(self): """testing if ValueError will be raised if the cost attribute is set to a negative number """ g = Good(**self.kwargs) with pytest.raises(ValueError) as cm: g.cost = -10 assert str(cm.value) == 'Good.cost should be a non-negative number'
def test_cost_attribute_is_not_a_number(self): """testing if a TypeError will be raised if the cost attribute is set to something other than a number """ g = Good(**self.kwargs) with pytest.raises(TypeError) as cm: g.cost = 'not a number' assert str(cm.value) == \ 'Good.cost should be a non-negative number, not str'
def test_cost_attribute_is_not_a_number(self): """testing if a TypeError will be raised if the cost attribute is set to something other than a number """ g = Good(**self.kwargs) with self.assertRaises(TypeError) as cm: g.cost = 'not a number' self.assertEqual(str(cm.exception), 'Good.cost should be a non-negative number, not str')
def test_cost_attribute_is_negative(self): """testing if ValueError will be raised if the cost attribute is set to a negative number """ g = Good(**self.kwargs) with self.assertRaises(ValueError) as cm: g.cost = -10 self.assertEqual(str(cm.exception), 'Good.cost should be a non-negative number')
def test_cost_attribute_is_zero(self): """testing if it is totally ok to test the cost attribute to 0 """ g = Good(**self.kwargs) self.assertNotEqual(g.cost, 0.0) g.cost = 0.0 self.assertEqual( g.cost, 0.0 )
def test_cost_attribute_is_not_a_number(self): """testing if a TypeError will be raised if the cost attribute is set to something other than a number """ g = Good(**self.kwargs) with self.assertRaises(TypeError) as cm: g.cost = 'not a number' self.assertEqual( str(cm.exception), 'Good.cost should be a non-negative number, not str' )
def test_cost_attribute_is_negative(self): """testing if ValueError will be raised if the cost attribute is set to a negative number """ g = Good(**self.kwargs) with self.assertRaises(ValueError) as cm: g.cost = -10 self.assertEqual( str(cm.exception), 'Good.cost should be a non-negative number' )
def test_cost_attribute_is_working_properly(self): """testing if the cost attribute value can be properly changed """ test_value = 145 g = Good(**self.kwargs) self.assertNotEqual( g.cost, test_value ) g.cost = test_value self.assertEqual( g.cost, test_value )