storage = <swh.storage.validate.ValidatingProxyStorage object at 0x7fe147aac550>
indexer_scheduler = <swh.scheduler.backend.SchedulerBackend object at 0x7fe147a8c588>
def test_journal_client(storage, indexer_scheduler):
"""Test the 'swh indexer journal-client' cli tool."""
message = FakeKafkaMessage(
"swh.journal.objects.origin_visit",
"bogus",
{"status": "full", "origin": {"url": "file://dev/0000",}},
)
consumer = MockedKafkaConsumer([message])
with patch("swh.journal.client.Consumer", return_value=consumer):
result = invoke(
indexer_scheduler,
False,
[
"journal-client",
"--stop-after-objects",
"1",
"--broker",
"192.0.2.1",
"--prefix",
"swh.journal.objects",
"--group-id",
> "test-consumer",
],
)
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_cli.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py3/lib/python3.7/site-packages/swh/indexer/tests/test_cli.py:94: in invoke
raise result.exception
.tox/py3/lib/python3.7/site-packages/click/testing.py:329: in invoke
cli.main(args=args or (), prog_name=prog_name, **extra)
.tox/py3/lib/python3.7/site-packages/click/core.py:782: in main
rv = self.invoke(ctx)
.tox/py3/lib/python3.7/site-packages/click/core.py:1259: in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
.tox/py3/lib/python3.7/site-packages/click/core.py:1066: in invoke
return ctx.invoke(self.callback, **ctx.params)
.tox/py3/lib/python3.7/site-packages/click/core.py:610: in invoke
return callback(*args, **kwargs)
.tox/py3/lib/python3.7/site-packages/click/decorators.py:21: in new_func
return f(get_current_context(), *args, **kwargs)
.tox/py3/lib/python3.7/site-packages/swh/indexer/cli.py:245: in journal_client
stop_after_objects=stop_after_objects,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ctx = <click.core.Context object at 0x7fe147aac208>
kwargs = {'brokers': ('192.0.2.1',), 'group_id': 'test-consumer', 'object_types': ['origin_visit'], 'prefix': 'swh.journal.objects', ...}
conf = {'indexer_storage': {'args': {}, 'cls': 'memory'}, 'scheduler': {'args': {}, 'cls': 'foo'}, 'storage': {'cls': 'memory'}}
def get_journal_client(ctx, **kwargs):
conf = ctx.obj["config"].copy()
if "journal" in conf:
warnings.warn(
"Journal client configuration should now be under the "
"`journal_client` field and have a `cls` argument.",
DeprecationWarning,
)
conf["journal_client"] = {"cls": "kafka", **conf.pop("journal")}
> client_conf = conf.get("journal_client").copy()
E AttributeError: 'NoneType' object has no attribute 'copy'
.tox/py3/lib/python3.7/site-packages/swh/journal/cli.py:73: AttributeError
TEST RESULT
TEST RESULT
- Run At
- Apr 23 2020, 2:33 PM