From d0162cfb3227dcd147b94dd6db16b18f01f82ef2 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Thu, 1 Oct 2020 14:35:33 +0200 Subject: [PATCH] Add a test for the "dosage @" feature --- tests/test_dosage.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_dosage.py b/tests/test_dosage.py index 59ce80acb..b72720cc8 100644 --- a/tests/test_dosage.py +++ b/tests/test_dosage.py @@ -134,6 +134,17 @@ class TestDosage(object): httpmocks.xkcd() cmd_ok("-n", "2", "-v", "-b", str(tmpdir), "xkcd:303") + @responses.activate + def test_fetch_all_existing(self, tmp_path): + httpmocks.xkcd() + xkcd = tmp_path / 'xkcd' + xkcd.mkdir() + other = tmp_path / 'randomdir' + other.mkdir() + cmd_ok('-v', '-b', str(tmp_path), '@') + assert len(list(xkcd.glob('*'))) == 2 + assert len(list(other.glob('*'))) == 0 + @responses.activate def test_json_page_key_bounce_and_multi_image(self, tmpdir): httpmocks.page('https://zenpencils.com/', 'zp-home')