Пример #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 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, [])
Пример #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."
     ])
Пример #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 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."
     ])
Пример #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."
     ])
Пример #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'."
     ])
Пример #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."
     ])
Пример #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."
     ])
Пример #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."
     ])