Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Do the conversion of crash IDs to arg/kwarg pairs in the right place.

That is, in the legacy crash source rather than in the processor app (and there assuming empty kwargs and a single arg).
  • Loading branch information...
commit ab894abf7a8c45383cc0c1edbfdd81c9528c997f 1 parent 45c2e59
@erikrose authored
View
2  socorro/processor/legacy_new_crash_source.py
@@ -247,7 +247,7 @@ def __iter__(self):
fetch_transform_save app"""
for a_legacy_job_tuple in self._job_iter():
if a_legacy_job_tuple:
- yield a_legacy_job_tuple[1]
+ yield (a_legacy_job_tuple[1],), {}
else:
yield None
View
5 socorro/processor/processor_app.py
@@ -88,10 +88,7 @@ def source_iterator(self):
)
while True: # loop forever and never raise StopIteration
for x in self.iterator():
- if x is None:
- yield None
- else:
- yield ((x,), {}) # (args, kwargs)
+ yield x # (args, kwargs) or None
else:
yield None # if the inner iterator yielded nothing at all,
# yield None to give the caller the chance to sleep
View
6 socorro/unittest/processor/test_legacy_new_crash_source.py
@@ -85,7 +85,7 @@ def _normal_jobs_iter(self):
'5678',
)
for x, y in zip(new_crash_source, expected):
- self.assertEqual(x, y)
+ self.assertEqual(x, ((y,), {}))
self.assertEqual(len([x for x in new_crash_source]), 5)
@@ -121,7 +121,7 @@ def _priority_jobs_iter(self):
'5678',
)
for x, y in zip(new_crash_source, expected):
- self.assertEqual(x, y)
+ self.assertEqual(x, ((y,), {}))
self.assertEqual(len([x for x in new_crash_source]), 5)
@@ -176,7 +176,7 @@ def _priority_jobs_iter(self):
'5678',
)
for x, y in zip(new_crash_source, expected):
- self.assertEqual(x, y)
+ self.assertEqual(x, ((y,), {}))
self.assertEqual(len([x for x in new_crash_source]), 10)
View
5 socorro/unittest/processor/test_processor_app.py
@@ -45,7 +45,10 @@ def get_standard_config(self):
)
config.new_crash_source = DotDict()
- sequence_generator = sequencer(1, 2, None, 3)
+ sequence_generator = sequencer(((1,), {}),
+ ((2,), {}),
+ None,
+ ((3,), {}))
mocked_new_crash_source = mock.Mock(side_effect=sequence_generator)
mocked_new_crash_source.id = 'mocked_new_crash_source'
config.new_crash_source.new_crash_source_class = mock.Mock(
Please sign in to comment.
Something went wrong with that request. Please try again.