Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_version():
assert libratom.__version__
(["--version"], libratom.__version__),
],
)
def test_ratom(cli_runner, params, expected):
result = cli_runner.invoke(ratom, args=params)
assert result.exit_code == 0
assert expected in result.output
with pytest.raises(ValueError):
db_session_from_cmd_out(result)
def store_configuration_in_db(
session: Session,
src: str,
jobs: int,
spacy_model: Optional[str] = None,
spacy_model_version: Optional[int] = None,
) -> None:
"""
Store configuration / environment information in the database output during a ratom command execution
"""
configuration = {
"source": src,
"jobs": jobs,
"libratom_version": libratom.__version__,
"spacy_model_name": spacy_model,
"spacy_model_version": spacy_model_version,
}
settings = [
Configuration(name=key, value=str(value))
for key, value in configuration.items()
]
settings.extend(
[
Configuration(name=key, value=str(value))
for key, value in get_ratom_settings()
]
)