Skip to content

Commit 0a63d9e

Browse files
committed
add a test to prevent regressions
1 parent 1f436d4 commit 0a63d9e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tests/linked/integration/test_sync.py

+16
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import time
88
import shutil
99
import timeit
10+
from datetime import datetime, timezone
1011
from typing import Union, Mapping, TypeVar, cast
1112

1213
import pytest
@@ -114,6 +115,21 @@ def test_file_lifecycle(m: Maestral, name: str) -> None:
114115
assert_synced(m, {})
115116

116117

118+
def test_remote_mtime_applied(m: Maestral) -> None:
119+
dbx_path = "/test.txt"
120+
local_path = m.to_local_path(dbx_path)
121+
mtime = datetime.fromisoformat("2019-12-04")
122+
m.client.dbx.files_upload(
123+
"content", dbx_path, mode=files.WriteMode.overwrite, client_modified=mtime
124+
)
125+
126+
wait_for_idle(m)
127+
128+
local_mtime = os.stat(local_path).st_mtime
129+
remote_mtime = mtime.replace(tzinfo=timezone.utc).timestamp()
130+
assert local_mtime == remote_mtime
131+
132+
117133
def test_folder_tree_local(m: Maestral) -> None:
118134
"""Tests the upload sync of a nested local folder structure."""
119135

0 commit comments

Comments
 (0)