def testDescribeUnixExecutable(self): msg = explain("wget --recursive") self.assertEqual(msg, '\n'.join([ PREAMBLE, "--recursive (-r): specify recursive download.", "" ]))
def testNoShowShortnameIfOptHasNoShortname(self): msg = explain("wget --retry-connrefused") self.assertEqual(msg, '\n'.join([ PREAMBLE, "--retry-connrefused: retry even if connection is refused.", "" ]))
def testAcceptLongPS1Header(self): msg = explain("johnny-o-user:2014 05 06:>>> wget --recursive") self.assertEqual(msg, '\n'.join([ PREAMBLE, "--recursive (-r): specify recursive download.", "" ]))
def testAcceptPathToExecutable(self): msg = explain("dir1/dir2/wget --recursive") self.assertEqual(msg, '\n'.join([ PREAMBLE, "--recursive (-r): specify recursive download.", "" ]))
def testDescribeOptionCombination(self): msg = explain("wget --recursive -A *.jpg -l3 http://google.com") self.assertEqual(msg, '\n'.join([ PREAMBLE + " This command downloads the page at http://google.com.", "Recursively scrape web pages linked from http://google.com of type '*.jpg', following links 3 times.", "--recursive (-r): specify recursive download.", "--accept (-A): *.jpg is a comma-separated list of accepted extensions.", "--level (-l): 3 is a maximum recursion depth (inf or 0 for infinite).", "" ]))
def testDescribeUrl(self): msg = explain("wget http://google.com") self.assertEqual(msg, '\n'.join([ PREAMBLE + " This command downloads the page at http://google.com.", "" ]))