From ca6746634422c5fba703463e315348e4fa191446 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Mon, 7 Nov 2022 14:36:28 +0100 Subject: [PATCH] Extend test for last modified sorting --- spacy/tests/test_cli.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/spacy/tests/test_cli.py b/spacy/tests/test_cli.py index 3aa4b23fc..e77a229f6 100644 --- a/spacy/tests/test_cli.py +++ b/spacy/tests/test_cli.py @@ -861,16 +861,24 @@ def test_span_length_freq_dist_output_must_be_correct(): def test_local_remote_storage(): with make_tempdir() as d: filename = "a.txt" - content = "a" + content = "newer context" loc_file = d / "root" / filename loc_file.parent.mkdir(parents=True) with loc_file.open(mode="w") as file_: - file_.write(content) + file_.write("older content") - # push to remote storage + # push first version to remote storage remote = RemoteStorage(d / "root", str(d / "remote")) + remote.push(filename, "aaaa", "aaaa") + + # push second version to remote storage + with loc_file.open(mode="w") as file_: + file_.write(content) remote.push(filename, "aaaa", "bbbb") + assert (d / "remote" / filename / "aaaa" / "bbbb").stat().st_mtime > ( + d / "remote" / filename / "aaaa" / "aaaa" + ).stat().st_mtime # retrieve with full hashes loc_file.unlink()