Exemple #1
0
 def test_flagparser(self):
     "Convert the flag args according to the property"
     decorating = nixargs.argmap({'-v': 'verbose', '--verbose': 'verbose'})
     decorated = decorating(self.f)
     cases = [('-v', {'verbose': True}), ('--verbose', {'verbose': True})]
     for arg, calling in cases:
         decorated(nixargs=arg)
         self.f.assert_called_with(**calling)
Exemple #2
0
 def test_flagparser(self):
     "Convert the flag args according to the property"
     decorating = nixargs.argmap({'-v': 'verbose', '--verbose': 'verbose'})
     decorated = decorating(self.f)
     cases = [
         ('-v', {'verbose': True}),
         ('--verbose', {'verbose': True})
         ]
     for arg, calling in cases:
         decorated(nixargs=arg)
         self.f.assert_called_with(**calling)
Exemple #3
0
 def test_invalidarg(self):
     "Convert the flag args according to the property"
     decorating = nixargs.argmap({})
     decorated = decorating(self.f)
     with self.assertRaises(ValueError):
         decorated(nixargs='-h')
Exemple #4
0
 def test_invalidarg(self):
     "Convert the flag args according to the property"
     decorating = nixargs.argmap({})
     decorated = decorating(self.f)
     with self.assertRaises(ValueError):
         decorated(nixargs='-h')