'Test Schema.to_schema_type method for type Integer.'

def test_to_schema_type_int(self):

    schema = constraints.Schema('Integer')
    res = schema.to_schema_type(1)
    self.assertIsInstance(res, int)
    res = schema.to_schema_type('1')
    self.assertIsInstance(res, int)
    err = self.assertRaises(ValueError, schema.to_schema_type, 1.5)
    self.assertEqual('Value    "1.5"    is    invalid    for    data    type    "Integer".', six.text_type(err))
    err = self.assertRaises(ValueError, schema.to_schema_type, '1.5')
    self.assertEqual('Value    "1.5"    is    invalid    for    data    type    "Integer".', six.text_type(err))
    err = self.assertRaises(ValueError, schema.to_schema_type, 'foo')
    self.assertEqual('Value    "foo"    is    invalid    for    data    type    "Integer".', six.text_type(err))
