def test_save_raw_crash(self): config = self.get_standard_config() b = BixieGETDestination(config) mock_urllib2_str = 'socorro.collector.bixie_submitter_utilities.urllib2' with mock.patch(mock_urllib2_str) as mock_urllib2: mock_response = mock.Mock() mock_response.read.return_value = 'ok' mock_urllib2.urlopen.return_value = mock_response b.save_raw_crash(raw_crash, {}, raw_crash['crash_id']) mock_urllib2.urlopen.assert_called_once_with(url_encoded_raw_crash)
def test_save_raw_crash_missing_sentry_entries(self): config = self.get_standard_config() b = BixieGETDestination(config) mock_urllib2_str = 'socorro.collector.bixie_submitter_utilities.urllib2' with mock.patch(mock_urllib2_str) as mock_urllib2: mock_response = mock.Mock() mock_response.read.return_value = 'ok' mock_urllib2.urlopen.return_value = mock_response not_a_bixie_crash = raw_crash.copy() del not_a_bixie_crash['sentry_data'] b.save_raw_crash(not_a_bixie_crash, {}, not_a_bixie_crash['crash_id']) self.assertEqual(mock_urllib2.urlopen.call_count, 0)
def test_save_raw_crash_missing_sentry_entries(self): config = self.get_standard_config() b = BixieGETDestination(config) mock_urllib2_str = 'socorro.collector.bixie_submitter_utilities.urllib2' with mock.patch(mock_urllib2_str) as mock_urllib2: mock_response = mock.Mock() mock_response.read.return_value = 'ok' mock_urllib2.urlopen.return_value = mock_response not_a_bixie_crash = raw_crash.copy() del not_a_bixie_crash['sentry_data'] b.save_raw_crash( not_a_bixie_crash, {}, not_a_bixie_crash['crash_id'] ) self.assertEqual(mock_urllib2.urlopen.call_count,0)
def test_setup(self): config = self.get_standard_config() c = BixieGETDestination(config) self.assertEqual(c.config, config) self.assertEqual(c.logger, config.logger)