From 472ed11e9f4cd04464e9145e8f8eb2bd0456e0c7 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Mon, 27 Jul 2026 21:52:44 +0200 Subject: [PATCH] test(cli): cover expiry preservation on moves - Assert tracked-file moves keep an existing remote expires_at value. - Keep the move regression focused on metadata preservation. --- tests/test_nanoshare_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_nanoshare_cli.py b/tests/test_nanoshare_cli.py index b4546d9..b25a137 100644 --- a/tests/test_nanoshare_cli.py +++ b/tests/test_nanoshare_cli.py @@ -95,7 +95,7 @@ def test_sync_uploads_nested_local_files(tmp_path, monkeypatch): def test_sync_updates_remote_path_when_tracked_file_moves(tmp_path, monkeypatch): fake = FakeClient() - fake.remote_files = [{'file_id': 'file_1', 'file_name': 'old.txt', 'file_path': '', 'file_size': '5 Bytes'}] + fake.remote_files = [{'file_id': 'file_1', 'file_name': 'old.txt', 'file_path': '', 'file_size': '5 Bytes', 'expires_at': 123456}] monkeypatch.setattr(cli, 'make_client', lambda args: fake) state_dir = tmp_path / '.nanoshare-sync' @@ -129,6 +129,7 @@ def test_sync_updates_remote_path_when_tracked_file_moves(tmp_path, monkeypatch) assert fake.deleted == [] assert fake.remote_files[0]['file_name'] == 'new.txt' assert fake.remote_files[0]['file_path'] == 'docs' + assert fake.remote_files[0]['expires_at'] == 123456 assert 'note' not in fake.remote_files[0] state = json.loads((state_dir / 'state.json').read_text()) assert 'old.txt' not in state['files']