Files
openfe/openfecli/tests/parameters/test_mapper.py
David W.H. Swenson 41068e0185 CLI for AtomMapping (#57)
* Initial skeleton for the CLI

Currently requires the OPS CLI to be installed as well; next steps:

1. Add parameter core classes to infrastructure
2. Fully separate infrastructure into its own package

* switch to using plugcli

* tests for CLI

* helps if you add the tests...

* pep8 and deps cleanup

* add test_plugins

* Start of CLI atommapping report

* Add tests for parameters

* Almost-working atommapping command

* add hack to work-around lomap issue

* fix test

* pep8; docstrings; add header comments

* Add tests for commands/atommapping

* docstrings

* add init to command to stop circular import error

* remove init and it still works?

Co-authored-by: richard <richard@nextmovesoftware.com>
2022-02-23 16:43:01 +00:00

20 lines
483 B
Python

import pytest
import click
from openfecli.parameters.mapper import get_atommapper
from openfe.setup import LomapAtomMapper
@pytest.mark.parametrize("user_input,expected", [
('LomapAtomMapper', LomapAtomMapper),
('openfe.setup.LomapAtomMapper', LomapAtomMapper),
])
def test_get_atommapper(user_input, expected):
assert get_atommapper(user_input) is expected
def test_get_atommapper_error():
with pytest.raises(click.BadParameter):
get_atommapper("foo")