Example #1
0
 def validate(value):
     if not utils.is_name_safe(value):
         raise exception.InvalidName(name=value)
     return value
Example #2
0
 def test_InvalidName(self):
     self.assertRaises(exception.InvalidName,
                       lambda: self.raise_(exception.InvalidName()))