Add compute_delta_named, routines_staging_files, compute_routines_delta so routines.json goes last in the push delta. Generalize push_file with subdir param (default podcasts, compat preserved). Fix test_delta.py: compute_delta lives in lisael_content, not lisael_server.
15 lines
623 B
Python
15 lines
623 B
Python
from lisael_content import compute_delta
|
|
|
|
def test_delta():
|
|
stg = ["oli_01.m4a", "oli.bin", "bestioles_01.mp3", "manifest.json"]
|
|
# empty box -> everything, manifest last
|
|
assert compute_delta(stg, []) == ["oli_01.m4a", "oli.bin", "bestioles_01.mp3", "manifest.json"]
|
|
# up-to-date box -> nothing (not even the manifest)
|
|
assert compute_delta(stg, ["oli_01.m4a", "oli.bin", "bestioles_01.mp3"]) == []
|
|
# box missing the cover -> .bin + manifest
|
|
assert compute_delta(stg, ["oli_01.m4a", "bestioles_01.mp3"]) == ["oli.bin", "manifest.json"]
|
|
print("OK")
|
|
|
|
if __name__ == "__main__":
|
|
test_delta()
|