Esempio n. 1
0
def test_atom_selection_error(cmd):
    """Test atom selection error."""
    parser = argparse.ArgumentParser()
    lc.add_atom_selection_arg(parser)
    with pytest.raises(SystemExit):
        parser.parse_args(cmd.split())
Esempio n. 2
0
__status__ = 'Production'

__doc__ += (f'{tcore.ref_mda}' f'{tcore.ref_mda_selection}')

_help = 'Extract trajectory frames to individual files.'
_name = 'fext'

ap = libcli.CustomParser(
    description=_BANNER + __doc__,
    formatter_class=argparse.RawDescriptionHelpFormatter,
)

libcli.add_version_arg(ap)
libcli.add_topology_arg(ap)
libcli.add_trajectories_arg(ap)
libcli.add_atom_selection_arg(ap)
libcli.add_frame_list_arg(ap)
libcli.add_slice_arg(ap)

ap.add_argument(
    '-f',
    '--prefix',
    help='String prefix for each file. Defaults to `frame_`.',
    default='frame_',
)

ap.add_argument(
    '-x',
    '--ext',
    help='Extension of frame files. Defaulst to .pdb',
    default='.pdb',
Esempio n. 3
0
def test_atom_selection_args(cmd, expected):
    """Test atom selection arg."""
    parser = argparse.ArgumentParser()
    lc.add_atom_selection_arg(parser)
    v = vars(parser.parse_args(cmd))
    assert v['selection'] == expected