示例#1
0
    def test_frame_output_gro(self):
        frame = Frame(self.data_dir.joinpath("water.gro"))

        with tempfile.TemporaryDirectory() as tmpdir:
            tmp_path = pathlib.Path(tmpdir)

            frame.save(tmp_path.joinpath("water-out.gro"))
            self.assertTrue(
                filecmp.cmp(
                    self.data_dir.joinpath("water.gro"),
                    tmp_path.joinpath("water-out.gro"),
                ))
示例#2
0
    def test_frame_write_xtc(self):
        """Test that :class:`Frame` can save a trajectory file."""
        frame = Frame(self.data_dir.joinpath("water.gro"),
                      self.data_dir.joinpath("water.xtc"))

        with tempfile.TemporaryDirectory() as tmpdir:
            tmp_path = pathlib.Path(tmpdir)

            frame.save(tmp_path.joinpath("water.xtc"))
            self.assertTrue(
                util.compare_trajectories(
                    self.data_dir.joinpath("water.xtc"),
                    tmp_path.joinpath("water.xtc"),
                    topology_file=self.data_dir.joinpath("water.gro"),
                ))