def test_validate_input_failure(self, _): """ Test: A ValueError is raised When: validate_input is called with an attribute who's value is None """ mock_self = Mock() mock_self.message = self.message mock_self.message.facility = None with self.assertRaises(ValueError): ReductionRunner.validate_input(mock_self, 'facility')
def test_validate_input_success(self, _): """ Test: The attribute value is returned When: validate_input is called with an attribute which is not None """ mock_self = Mock() mock_self.message = self.message actual = ReductionRunner.validate_input(mock_self, 'facility') self.assertEqual(actual, self.message.facility)