From 92abd6b627a6bde0069249c6a9cea3cc44e34a6f Mon Sep 17 00:00:00 2001 From: Roland Date: Thu, 15 Dec 2022 14:06:03 -0700 Subject: [PATCH] Testing that File.a_text is filled even if the file does not match an indexer. --- wrolpi/files/test/test_lib.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/wrolpi/files/test/test_lib.py b/wrolpi/files/test/test_lib.py index cd367427..c012e62f 100644 --- a/wrolpi/files/test/test_lib.py +++ b/wrolpi/files/test/test_lib.py @@ -185,6 +185,17 @@ async def test_refresh_files(test_session, make_files_structure, test_directory) assert_files(test_session, []) +@pytest.mark.asyncio +async def test_refresh_a_text_no_indexer(test_session, make_files_structure): + """File.a_text is filled even if the file does not match an Indexer.""" + make_files_structure(['foo', 'bar-bar']) + + await lib.refresh_files() + + files = {i.a_text for i in test_session.query(File).all()} + assert files == {'{bar,bar-bar}', '{foo}'} + + @pytest.mark.asyncio async def test_refresh_many_files(test_session, make_files_structure): """Used to profile file refreshing"""