예제 #1
0
    def test_transform(self):
        config = self.get_standard_config()
        sub = SubmitterApp(config)
        sub._setup_source_and_destination()

        crash_id = '86b58ff2-9708-487d-bfc4-9dac32121214'

        fake_raw_crash = DotDict()
        mocked_get_raw_crash = mock.Mock(return_value=fake_raw_crash)
        sub.source.get_raw_crash = mocked_get_raw_crash

        fake_dump = {'upload_file_minidump': 'fake dump'}
        mocked_get_raw_dumps_as_files = mock.Mock(return_value=fake_dump)
        sub.source.get_raw_dumps_as_files = mocked_get_raw_dumps_as_files

        sub.destination.save_raw_crash = mock.Mock()

        sub.transform(crash_id)
        sub.source.get_raw_crash.assert_called_with(crash_id)
        sub.source.get_raw_dumps_as_files.assert_called_with(crash_id)
        sub.destination.save_raw_crash_with_file_dumps.assert_called_with(
            fake_raw_crash,
            fake_dump,
            crash_id
        )
예제 #2
0
    def test_transform(self):
        config = self.get_standard_config()
        sub = SubmitterApp(config)
        sub._setup_source_and_destination()

        crash_id = '86b58ff2-9708-487d-bfc4-9dac32121214'

        fake_raw_crash = DotDict()
        mocked_get_raw_crash = mock.Mock(return_value=fake_raw_crash)
        sub.source.get_raw_crash = mocked_get_raw_crash

        fake_dump = {'upload_file_minidump': 'fake dump'}
        mocked_get_raw_dumps_as_files = mock.Mock(return_value=fake_dump)
        sub.source.get_raw_dumps_as_files = mocked_get_raw_dumps_as_files

        sub.destination.save_raw_crash = mock.Mock()

        sub.transform(crash_id)
        sub.source.get_raw_crash.assert_called_with(crash_id)
        sub.source.get_raw_dumps_as_files.assert_called_with(crash_id)
        sub.destination.save_raw_crash_with_file_dumps.assert_called_with(
            fake_raw_crash,
            fake_dump,
            crash_id
        )