def test_wrong_ff_fail(self): qlib = QLib("amber", ignore_errors=True) with pytest.raises(QLibError): qlib.read_ffld("data/ace_ash_nma.ffld11", None) qlib = QLib("oplsaa", ignore_errors=True) with pytest.raises(QLibError): qlib.read_amber_lib("data/ff-amber14/lib/amino12.lib") with pytest.raises(QLibError): qlib.read_prepin_impropers("data/ff-amber14/lib/amino12.lib") with pytest.raises(QLibError): qlib.read_mol2("data/all_amino_acids.mol2")
for k, v in six.iteritems(vars(args)): if k in ["mol2", "prepi", "parm", "frcmods"]: for fn in v: if not os.path.lexists(fn): print("File '{}' doesn't exist.".format(fn)) sys.exit(1) # # create QLib, QPrm, QStruct and QTopology objects # qlib = QLib("amber", ignore_errors=args.ignore_errors) qprm = QPrm("amber", ignore_errors=args.ignore_errors) try: qlib.read_mol2(args.mol2[0]) except QLibError as e: print("FATAL! Problem with mol2: {}".format(str(e))) sys.exit(1) try: qlib.read_prepin_impropers(args.prepi[0]) except QLibError as e: print("FATAL! Problem with prepi: {}".format(str(e))) sys.exit(1) for parm in args.parms: try: qprm.read_amber_parm(parm) except QPrmError as e: print("FATAL! Problem with parm: {}".format(str(e))) sys.exit(1)