keystoneauth1.fixture.serializer module¶
A serializer to emit YAML but with request body in nicely formatted JSON.
-
class
keystoneauth1.fixture.serializer.
YamlJsonSerializer
Bases:
betamax.serializers.base.BaseSerializer
-
__doc__
= None
-
__module__
= 'keystoneauth1.fixture.serializer'
-
deserialize
(cassette_data) A method that must be implemented by the Serializer author.
The return value is extremely important. If it is not empty, the dictionary returned must have the following structure:
{ 'http_interactions': [{ # Interaction }, { # Interaction }], 'recorded_with': 'name of recorder' }
- Params str cassette_data
The data serialized as a string which needs to be deserialized.
- Returns
dictionary
-
static
generate_cassette_name
(cassette_library_dir, cassette_name)
-
name
= 'yamljson'
-
serialize
(cassette_data) A method that must be implemented by the Serializer author.
- Parameters
cassette_data (dict) – A dictionary with two keys:
http_interactions
,recorded_with
.- Returns
Serialized data as a string.
-
-
keystoneauth1.fixture.serializer.
_indent_json
(val)
-
keystoneauth1.fixture.serializer.
_is_json_body
(interaction)
-
keystoneauth1.fixture.serializer.
_represent_scalar
(self, tag, value, style=None)
-
keystoneauth1.fixture.serializer.
_should_use_block
(value)
-
keystoneauth1.fixture.serializer.
_unicode_representer
(dumper, uni)