Пример #1
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)
     self.assertNotEqual(g.msrp, 0.0)
     g.msrp = 0.0
     self.assertEqual(g.msrp, 0.0)
Пример #2
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
Пример #3
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
Пример #4
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)
Пример #5
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)
Пример #6
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)
Пример #7
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)
        assert g.msrp != test_value

        g.msrp = test_value
        assert g.msrp == test_value
Пример #8
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 pytest.raises(ValueError) as cm:
            g.msrp = -10

        assert str(cm.value) == \
            'Good.msrp should be a non-negative number'
Пример #9
0
    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'
Пример #10
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')
Пример #11
0
    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')
Пример #12
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)
     self.assertNotEqual(g.msrp, 0.0)
     g.msrp = 0.0
     self.assertEqual(
         g.msrp,
         0.0
     )
Пример #13
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'
        )
Пример #14
0
    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'
        )
Пример #15
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
     )