Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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')
Exemplo n.º 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')