mirror of
https://github.com/dredx/prole.git
synced 2026-09-23 12:03:59 +00:00
- Add build-context helper to copy Docker context safely (ignore runtime data, keep symlinks) - Update UI and core actions to use ~/.prole/build and shared copy helper - Add/adjust tests and scripts; introduce knoe ops helpers and update manifests Co-authored-by: Junie <junie@jetbrains.com>
20 lines
472 B
Python
20 lines
472 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from knoe.ops.files import write_if_changed
|
|
|
|
|
|
def test_write_if_changed(tmp_path: Path):
|
|
p = tmp_path / "a.txt"
|
|
|
|
assert write_if_changed(p, "hello\n") is True
|
|
assert p.read_text(encoding="utf-8") == "hello\n"
|
|
|
|
# Unchanged
|
|
assert write_if_changed(p, "hello\n") is False
|
|
|
|
# Changed
|
|
assert write_if_changed(p, "hello2\n") is True
|
|
assert p.read_text(encoding="utf-8") == "hello2\n"
|