Example #1
0
    def test_turnoff(self, tmpdir):
        httpmocks.page('https://turnoff.us/', 'turnoff-home')
        httpmocks.page('https://turnoff.us/geek/the-bad-design-punisher',
                       'turnoff-229')

        httpmocks.png(re.compile(r'https://turnoff\.us/image/en/.*\.png'))

        cmd('--numstrips', '2', '--basepath', str(tmpdir), 'turnoff')
Example #2
0
    def test_gocomics_index(self, tmpdir):
        httpmocks.page('https://www.gocomics.com/calvinandhobbesespanol',
                       'gocomics-root')
        httpmocks.page(re.compile('.*espanol/2020/03/25'), 'gocomics-page')
        httpmocks.page(re.compile('.*espanol/2012/07/22'), 'gocomics-page')

        httpmocks.png(re.compile(r'https://assets\..*'))

        cmd('--basepath', str(tmpdir), 'CalvinAndHobbesEnEspanol')
        cmd('--basepath', str(tmpdir), 'CalvinAndHobbesEnEspanol:2012/07/22')
Example #3
0
 def test_unknown_option(self):
     with pytest.raises(SystemExit):
         cmd('--imadoofus')
Example #4
0
 def test_display_help(self):
     for option in ("-h", "--help"):
         with pytest.raises(SystemExit):
             cmd(option)
Example #5
0
def cmd_err(*options):
    assert cmd(*options) == 1
Example #6
0
def cmd_ok(*options):
    assert cmd(*options) == 0
Example #7
0
 def test_unknown_option(self):
     with pytest.raises(SystemExit):
         cmd('--imadoofus')
Example #8
0
 def test_display_help(self):
     for option in ("-h", "--help"):
         with pytest.raises(SystemExit):
             cmd(option)
Example #9
0
def cmd_err(*options):
    assert cmd(*options) == 1
Example #10
0
def cmd_ok(*options):
    assert cmd(*options) == 0