예제 #1
0
    def test_should_not_execute_normalize_message_when_message_option_is_not_given(self, normalize_message):
        normalize_message.return_value = 'normalized message'
        options_without_message = object()

        normalize_options(options_without_message)

        normalize_message.assert_not_called()
예제 #2
0
    def test_should_not_execute_normalize_message_when_message_option_is_none(self, normalize_message):
        normalize_message.return_value = 'normalized message'

        options_with_none_message = self.MockedOptions()
        options_with_none_message.message = None

        actual_options = normalize_options(options_with_none_message)

        normalize_message.assert_not_called()
        self.assertEqual(actual_options.message, None)