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

Method test_serialization_cache

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

Source from the content-addressed store, hash-verified

885 self.assertEqual(shape.name, 'StringType')
886
887 def test_serialization_cache(self):
888 shape_map = {
889 'Foo': {
890 'type': 'structure',
891 'members': {
892 'Baz': {'shape': 'StringType', 'locationName': 'other'},
893 },
894 },
895 "StringType": {"type": "string"},
896 }
897 resolver = model.ShapeResolver(shape_map)
898 shape = resolver.resolve_shape_ref(
899 {'shape': 'StringType', 'locationName': 'other'}
900 )
901 self.assertEqual(shape.serialization['name'], 'other')
902 # serialization is computed on demand, and a cache is kept.
903 # This is just verifying that trying to access serialization again
904 # gives the same result. We don't actually care that it's cached,
905 # we just care that the cache doesn't mess with correctness.
906 self.assertEqual(shape.serialization['name'], 'other')
907
908 def test_shape_overrides(self):
909 shape_map = {

Callers

nothing calls this directly

Calls 1

resolve_shape_refMethod · 0.95

Tested by

no test coverage detected