From bbbffc29dffd21dcb48a4eff52d2134b73a390b1 Mon Sep 17 00:00:00 2001 From: Sebastien Williams-Wynn Date: Mon, 11 Nov 2019 20:49:54 +0000 Subject: [PATCH] Write test to explain behaviour of .info --- fsspec/tests/test_spec.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/fsspec/tests/test_spec.py b/fsspec/tests/test_spec.py index 14fc66d78..e2eb23404 100644 --- a/fsspec/tests/test_spec.py +++ b/fsspec/tests/test_spec.py @@ -75,3 +75,15 @@ def test_glob(test_path, expected): def test_add_docs_warns(): with pytest.warns(FutureWarning, match="add_docs"): AbstractFileSystem(add_docs=True) + + +def test_exists(): + """ Test calling `exists` and `info` on partially completed file/directory names.""" + test_fs = DummyTestFS() + + assert test_fs.exists("top_level/second") + assert test_fs.exists("top_level/second_level/date/") + assert test_fs.exists("top_level/second_level/date=2019-10-01/a.parq") + + info = test_fs.info("top_level/second_level/date=2019-10-01/a.parq") + assert info["type"] == "directory"