Files
openfe/openfecli/tests/parameters/test_utils.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

17 lines
427 B
Python

import os
import pytest
from plugcli.params import NOT_PARSED
from openfecli.parameters.utils import import_parameter
@pytest.mark.parametrize('import_str,expected', [
('os.path.exists', os.path.exists),
('os.getcwd', os.getcwd),
('os.foo', NOT_PARSED),
('foo.bar', NOT_PARSED),
('foo', NOT_PARSED),
])
def test_import_parameter(import_str, expected):
assert import_parameter(import_str) is expected