def test_run_failure(self):
     custom_args = {"vdw_cutoff": 17.0 * u.angstrom}
     with temporary_directory() as tmp_dir:
         with temporary_cd(tmp_dir):
             with pytest.raises(CassandraRuntimeError,
                                match=r"Cassandra exited with"):
                 ex.run_nvt(**custom_args)
示例#2
0
    def test_run_nvt_custom_mixing(self):
        mixing_dict = {"opls_138_s1 opls_140_s1": "1.0 1.0"}
        custom_args = {
            "mixing_rule": "custom",
            "custom_mixing_dict": mixing_dict,
        }
        with temporary_directory() as tmp_dir:
            with temporary_cd(tmp_dir):
                ex.run_nvt(**custom_args)
                log_files = sorted(glob.glob("./mosdef_cassandra*.log"),
                                   key=os.path.getmtime)
                log_file = log_files[-1]
                log_data = []
                save_data = False
                with open(log_file) as log:
                    for line in log:
                        if "CASSANDRA STANDARD" in line:
                            save_data = True
                        if save_data:
                            log_data.append(line)

                completed = False
                for line in log_data:
                    if "Cassandra simulation complete" in line:
                        completed = True
                assert completed
    def test_run_nvt(self):
        with temporary_directory() as tmp_dir:
            with temporary_cd(tmp_dir):
                ex.run_nvt()
                log_files = sorted(glob.glob("./mosdef_cassandra*.log"),
                                   key=os.path.getmtime)
                log_file = log_files[-1]
                log_data = []
                save_data = False
                with open(log_file) as log:
                    for line in log:
                        if "CASSANDRA STANDARD" in line:
                            save_data = True
                        if save_data == True:
                            log_data.append(line)

                completed = False
                for line in log_data:
                    if "Cassandra simulation complete" in line:
                        completed = True
                assert completed