mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-07-06 00:21:29 +00:00

### Description Given that many of the options associated with the `Click` based cli ingest commands are added dynamically from a number of configs, a check was incorporated to make sure there were no duplicate entries to prevent new configs from overwriting already added options. ### Issues that were found and fixes: * duplicate api-key option set on Notion command conflicts with api key used for unstructured api. Added notion prefix. * retry logic configs had duplicates in biomed. Removed since this is not handled by the pipeline.
19 lines
366 B
Python
19 lines
366 B
Python
import click
|
|
import pytest
|
|
|
|
from unstructured.ingest.cli.interfaces import CliMixin
|
|
|
|
|
|
def test_add_params():
|
|
@click.command()
|
|
def sample_cmd():
|
|
pass
|
|
|
|
options = [
|
|
click.Option(["--opt1"]),
|
|
click.Option(["--opt1"]),
|
|
]
|
|
cmd = sample_cmd
|
|
with pytest.raises(ValueError):
|
|
CliMixin.add_params(cmd=cmd, params=options)
|