예제 #1
0
 def testNoExplanationIfNoCombos(self):
     url = "http://google.com"
     # Random grouping of non-existent arguments
     options = [
         Option('', '--tweedledee', None),
         Option('', '--tweedledum', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [])
예제 #2
0
 def testDescribeRLCombination(self):
     url = "http://google.com"
     options = [
         Option('-l', '--level', '4'),
         Option('-r', '--recursive', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Recursively scrape web pages linked from http://google.com, recursing 4 times."
     ])
예제 #3
0
 def testDescribeRACombination(self):
     url = "http://google.com"
     options = [
         Option('-A', '--accept', '*.jpg'),
         Option('-r', '--recursive', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Recursively scrape web pages linked from http://google.com of type '*.jpg'."
     ])
예제 #4
0
 def testDescribeUserPwCombination(self):
     url = "http://google.com"
     options = [
         Option('', '--user', 'me'),
         Option('', '--password', 'pw'),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Authenticate at http://google.com with username 'me' and password 'pw'."
     ])
예제 #5
0
 def testDescribeRALCombination(self):
     # Note that this should *not* also generate a description for RA or RL, to avoid redundancy
     url = "http://google.com"
     options = [
         Option('-l', '--level', '4'),
         Option('-A', '--accept', '*.jpg'),
         Option('-r', '--recursive', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Recursively scrape web pages linked from http://google.com of type '*.jpg', following links 4 times."
     ])