Logo
Explore Help
Register Sign In
yujunjun/unstructured
1
0
Fork 0
You've already forked unstructured
mirror of https://github.com/Unstructured-IO/unstructured.git synced 2025-07-08 17:46:54 +00:00
Code Issues Packages Projects Releases Wiki Activity
unstructured/test_unstructured_ingest/unit/cli/test_cli.py

19 lines
366 B
Python
Raw Normal View History

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 10:00:19 -04:00
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)
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.5 Page: 276ms Template: 8ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API