Roman Isecke 63861f537e
Add check for duplicate click options (#1775)
### 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.
2023-10-20 14:00:19 +00:00

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)