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