MCPcopy Create free account
hub / github.com/Cantera/cantera / test_overwrite_yaml

Method test_overwrite_yaml

test/python/test_composite.py:745–759  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

743 self.run_overwrite("h5")
744
745 def test_overwrite_yaml(self):
746 overwritten, fresh = self.run_overwrite("yaml")
747
748 # Check that keys are written in the same order in both newly-created
749 # and overwritten files
750 reader = yaml.YAML(typ="rt")
751 yml1 = reader.load(fresh)
752 yml2 = reader.load(overwritten)
753
754 assert list(yml1["arr"]) == list(yml2["arr"])
755 assert list(yml1["arr"]["data"]) == list(yml2["arr"]["data"])
756
757 # Header fields come first, and in the desired order
758 assert (list(yml1["arr"])[:4]
759 == ["generator", "cantera-version", "git-commit", "date"])
760
761 def run_overwrite(self, mode):
762 outfile = self.test_work_path / f"solutionarray_overwrite.{mode}"

Callers

nothing calls this directly

Calls 1

run_overwriteMethod · 0.95

Tested by

no test coverage detected