def test_traj_output_arg_error(cmd): """Test top output error.""" parser = argparse.ArgumentParser() lc.add_traj_output_arg(parser) with pytest.raises(SystemExit): parser.parse_args([cmd])
__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_trajectories_arg(ap) libcli.add_insort_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_trajoutput_args(cmd, expected): """Test traj output.""" parser = argparse.ArgumentParser() lc.add_traj_output_arg(parser) v = vars(parser.parse_args(cmd.split())) assert v['traj_output'] == expected