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)
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)
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')