Skip to content

Commit dd2b317

Browse files
committed
Fix task.toml writing.
1 parent 520cfdf commit dd2b317

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

src/harbor/models/task/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def model_dump_toml(self) -> str:
424424
parts.append(toml.dumps({field: value}))
425425
emitted.add(field)
426426

427-
return "\n".join(part.strip() for part in parts if part.strip()) + "\n"
427+
return "\n\n".join(part.strip() for part in parts if part.strip()) + "\n"
428428

429429
@staticmethod
430430
def _is_toml_table_like(value: Any) -> bool:

tests/unit/models/test_task_config_toml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ def test_model_dump_toml_orders_task_before_steps_and_sections():
2929
assert content.index("[verifier]") < content.index("[agent]")
3030
assert content.index("[agent]") < content.index("[environment]")
3131
assert content.index("[environment]") < content.index("[solution.env]")
32+
assert "\n\n[task]\n" in content
33+
assert "\n\n[[steps]]\n" in content
34+
assert "\n\n[metadata]\n" in content
3235

3336
data = tomllib.loads(content)
3437
assert data["task"]["name"] == "org/example"

0 commit comments

Comments
 (0)