Ejemplo n.º 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, [])
Ejemplo n.º 2
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, [])
Ejemplo n.º 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 of type '*.jpg' from http://google.com."
     ])
Ejemplo n.º 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'."
     ])
Ejemplo n.º 5
0
 def testDescribeRLCombinationWithSingularTime(self):
     url = "http://google.com"
     options = [
         Option('-l', '--level', '1'),
         Option('-r', '--recursive', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Recursively scrape web pages from http://google.com, following links 1 time."
     ])
Ejemplo n.º 6
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 of type '*.jpg' from http://google.com."
     ])
Ejemplo n.º 7
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'."
     ])
Ejemplo n.º 8
0
 def testDescribeRLCombinationWithSingularTime(self):
     url = "http://google.com"
     options = [
         Option('-l', '--level', '1'),
         Option('-r', '--recursive', None),
     ]
     exps = optcombo_explain(url, options)
     self.assertEqual(exps, [
         "Recursively scrape web pages from http://google.com, following links 1 time."
     ])
Ejemplo n.º 9
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 of type '*.jpg' from http://google.com, "
         + "following links 4 times."
     ])
Ejemplo n.º 10
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 of type '*.jpg' from http://google.com, " +
         "following links 4 times."
     ])