Esempio n. 1
0
 def test_that_function_raise_http400_when_price_is_negative(self):
     with self.assertRaises(ConcentValidationError):
         validate_positive_integer_value(-5)
Esempio n. 2
0
 def test_that_function_will_not_return_anything_when_price_is_zero(self):  # pylint: disable=no-self-use
     validate_positive_integer_value(0)
Esempio n. 3
0
 def test_that_function_raise_exception_when_price_is_not_int(self):
     with self.assertRaises(ConcentValidationError):
         validate_positive_integer_value('5')
Esempio n. 4
0
 def test_that_function_raise_exception_when_price_is_zero(self):  # pylint: disable=no-self-use
     with self.assertRaises(ConcentValidationError):
         validate_positive_integer_value(0)
Esempio n. 5
0
 def test_that_validate_positive_integer_function_raise_exception_when_wrong_value_given(
         self, value, error_code):
     with pytest.raises(ConcentValidationError) as exception_wrapper:
         validate_positive_integer_value(value)
     assert_that(exception_wrapper.value.error_code).is_equal_to(error_code)