mock.sentinel.ccc

Here are the examples of the python api mock.sentinel.ccc taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : test_generic.py
with GNU Affero General Public License v3.0
from CERT-Polska

    def test__get_output_components(self):
        mock = Mock(
            __class__=BaseCollector,
            process_input_data=Mock(return_value=dict(ccc=sentinel.ccc,
                                                      dddd=sentinel.dddd)),
            get_source_channel=Mock(return_value=SAMPLE_SOURCE_CHANNEL),
            get_source=Mock(return_value=SAMPLE_SOURCE),
            get_output_rk=Mock(return_value=SAMPLE_OUTPUT_RK),
            get_output_data_body=Mock(return_value=SAMPLE_OUTPUT_DATA_BODY),
            get_output_prop_kwargs=Mock(
                    return_value=SAMPLE_OUTPUT_PROP_KWARGS))
        # the call
        (output_rk,
         output_data_body,
         output_prop_kwargs) = BaseCollector.get_output_components(
            mock, a=SAMPLE_ARG_A, bb=SAMPLE_ARG_B)
        # assertions
        self.assertIs(output_rk, SAMPLE_OUTPUT_RK)
        self.assertIs(output_data_body, SAMPLE_OUTPUT_DATA_BODY)
        self.assertIs(output_prop_kwargs, SAMPLE_OUTPUT_PROP_KWARGS)
        self.assertEqual(mock.mock_calls, [
            call.process_input_data(a=SAMPLE_ARG_A, bb=SAMPLE_ARG_B),
            call.get_source_channel(ccc=sentinel.ccc, dddd=sentinel.dddd),
            call.get_source(
                    source_channel=SAMPLE_SOURCE_CHANNEL,
                    ccc=sentinel.ccc, dddd=sentinel.dddd),
            call.get_output_rk(
                    source=SAMPLE_SOURCE,
                    ccc=sentinel.ccc, dddd=sentinel.dddd),
            call.get_output_data_body(
                    source=SAMPLE_SOURCE,
                    ccc=sentinel.ccc, dddd=sentinel.dddd),
            call.get_output_prop_kwargs(
                    source=SAMPLE_SOURCE,
                    output_data_body=SAMPLE_OUTPUT_DATA_BODY,
                    ccc=sentinel.ccc, dddd=sentinel.dddd),
        ])

    def test__process_input_data(self):