Example #1
0
 def test_validate_max_length(self):
     tm = TeaModel()
     tm.validate_max_length('test', 'prop_name', 10)
     self.assertRaises(Exception,
                       tm.validate_max_length,
                       prop='test',
                       prop_name='prop_name',
                       max_length=1)
Example #2
0
    def test_validate_max_length(self):
        tm = TeaModel()
        tm.validate_max_length('test', 'prop_name', 10)

        try:
            tm.validate_max_length('test', 'prop_name', 1)
            assert False
        except Exception as e:
            self.assertEqual('prop_name is exceed max-length: 1', str(e))