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
def test_fetch_indexed(self, tmpdir): httpmocks.xkcd() cmd_ok("-n", "2", "-v", "-b", str(tmpdir), "xkcd:303")
def test_fetch_html_and_rss_json(self, tmpdir): httpmocks.xkcd() cmd_ok("-n", "2", "-v", "-b", str(tmpdir), "-o", "html", "-o", "rss", "-o", "json", "xkcd")