Did I find the right examples for you? yes no

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)

src/w/s/WSME-0.6/wsme/rest/json.py   WSME(Download)
                raise InvalidInput(attrdef.name, None,
                                   "Mandatory field missing.")
        return wsme.types.validate_value(datatype, obj)
    elif wsme.types.isusertype(datatype):
        value = datatype.frombasetype(

src/w/s/wsme-HEAD/wsme/rest/json.py   wsme(Download)
                raise InvalidInput(attrdef.name, None,
                                   "Mandatory field missing.")
        return wsme.types.validate_value(datatype, obj)
    elif wsme.types.isusertype(datatype):
        value = datatype.frombasetype(

src/w/s/WSME-0.6/wsme/rest/xml.py   WSME(Download)
                raise InvalidInput(attrdef.name, None,
                                   "Mandatory field missing.")
        return wsme.types.validate_value(datatype, obj)
    if datatype is wsme.types.bytes:
        return element.text.encode('ascii')

src/w/s/wsme-HEAD/wsme/rest/xml.py   wsme(Download)
                raise InvalidInput(attrdef.name, None,
                                   "Mandatory field missing.")
        return wsme.types.validate_value(datatype, obj)
    if datatype is wsme.types.bytes:
        return element.text.encode('ascii')

src/w/s/WSME-0.6/wsme/tests/test_types.py   WSME(Download)
    def test_validate_dict(self):
        assert types.validate_value({int: str}, {1: '1', 5: '5'})
 
        self.assertRaises(ValueError, types.validate_value,
                          {int: str}, [])
 
        assert types.validate_value({int: str}, {'1': '1', 5: '5'})
    def test_validate_list_valid(self):
        assert types.validate_value([int], [1, 2])
        assert types.validate_value([int], ['5'])
 
    def test_validate_list_empty(self):
        assert types.validate_value([int], []) == []

src/w/s/wsme-HEAD/wsme/tests/test_types.py   wsme(Download)
    def test_validate_dict(self):
        assert types.validate_value({int: str}, {1: '1', 5: '5'})
 
        self.assertRaises(ValueError, types.validate_value,
                          {int: str}, [])
 
        assert types.validate_value({int: str}, {'1': '1', 5: '5'})
    def test_validate_list_valid(self):
        assert types.validate_value([int], [1, 2])
        assert types.validate_value([int], ['5'])
 
    def test_validate_list_empty(self):
        assert types.validate_value([int], []) == []