def test_trajectory_error(): """Test error in trajectory input.""" parser = argparse.ArgumentParser() lc.add_trajectory_arg(parser) with pytest.raises(SystemExit): parser.parse_args('traj1.dcd traj2.dcd'.split())
__credits__ = ['Joao M.C. Teixeira'] __status__ = 'Production' __doc__ += tcore.ref_mdt _help = 'Removes solvent from trajectory.' _name = 'nosol' ap = libcli.CustomParser( description=_BANNER + __doc__, formatter_class=argparse.RawDescriptionHelpFormatter, ) libcli.add_version_arg(ap) libcli.add_topology_arg(ap) libcli.add_trajectory_arg(ap) libcli.add_traj_output_arg(ap) libcli.add_top_output_arg(ap) ap.add_argument( '-m', '--maintain', help=('List of solvent residue names to maintain in trajectory. ' 'Feeds MDTraj.Trajectory.remove_solvent.exclude parameter.'), default=None, nargs='+', ) def _ap(): return ap
def test_trajectory(cmd, expected): """Test trajectory argument.""" parser = argparse.ArgumentParser() lc.add_trajectory_arg(parser) v = vars(parser.parse_args(cmd.split())) assert v['trajectory'] == expected