def test_round_trip(bwamem_help): command = parse_help(["bwa", "mem"], bwamem_help) # Dump buffer = StringIO() yaml.dump(command, buffer) # Load buffer.seek(0) output = yaml.load(buffer) # Assert the round trip worked assert command == output
def save_to_file(self, cmd: Command, path: Path) -> None: map = self.command_to_tool(cmd).save() with path.open("w") as fp: yaml.dump(map, fp)
def save_to_string(self, cmd: Command) -> str: buffer = StringIO() yaml.dump(cmd, buffer) return buffer.getvalue()
def save_to_string(self, cmd: Command) -> str: io = StringIO() yaml.dump(self.command_to_tool(cmd).save(), io) return io.getvalue()
def save_to_file(self, cmd: Command, path: Path) -> None: with path.open("w") as fp: yaml.dump(cmd, fp)