示例#1
0
 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
示例#2
0
 def test_fetch_indexed(self, tmpdir):
     httpmocks.xkcd()
     cmd_ok("-n", "2", "-v", "-b", str(tmpdir), "xkcd:303")
示例#3
0
 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")
示例#4
0
 def test_fetch_indexed(self, tmpdir):
     httpmocks.xkcd()
     cmd_ok("-n", "2", "-v", "-b", str(tmpdir), "xkcd:303")
示例#5
0
 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")