mirror of
				https://github.com/Unstructured-IO/unstructured.git
				synced 2025-10-31 01:54:25 +00:00 
			
		
		
		
	 63861f537e
			
		
	
	
		63861f537e
		
			
		
	
	
	
	
		
			
			### 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)
 |