MCPcopy Create free account
hub / github.com/aws/aws-cli / test_exception_error_code

Method test_exception_error_code

tests/unit/botocore/test_model.py:948–966  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

946 self.assertEqual(shape.error_code, None)
947
948 def test_exception_error_code(self):
949 shapes = {
950 'FooException': {
951 'exception': True,
952 'type': 'structure',
953 'members': {},
954 }
955 }
956 # Test without explicit error code
957 resolver = model.ShapeResolver(shapes)
958 shape = resolver.get_shape_by_name('FooException')
959 self.assertTrue(shape.metadata['exception'])
960 self.assertEqual(shape.error_code, 'FooException')
961 # Test with explicit error code
962 shapes['FooException']['error'] = {'code': 'ExceptionCode'}
963 resolver = model.ShapeResolver(shapes)
964 shape = resolver.get_shape_by_name('FooException')
965 self.assertTrue(shape.metadata['exception'])
966 self.assertEqual(shape.error_code, 'ExceptionCode')
967
968 def test_shape_metadata(self):
969 shapes = {

Callers

nothing calls this directly

Calls 1

get_shape_by_nameMethod · 0.95

Tested by

no test coverage detected