Пример #1
0
 def test_validate_pattern(self):
     tm = TeaModel()
     tm.validate_pattern('test', 'prop_name', 't')
     self.assertRaises(Exception,
                       tm.validate_pattern,
                       prop='test',
                       prop_name='prop_name',
                       pattern='q')
Пример #2
0
    def test_validate_pattern(self):
        tm = TeaModel()
        tm.validate_pattern('test', 'prop_name', 't')

        tm.validate_pattern(123.1, 'prop_name', '1')

        try:
            tm.validate_pattern('test', 'prop_name', '1')
            assert False
        except Exception as e:
            self.assertEqual('prop_name is not match: 1', str(e))