<s> import json <EOL> from pytest import raises <EOL> from graphql . core . error import GraphQLError , format_error <EOL> from graphql . core . execution import execute <EOL> from graphql . core . language . parser import parse <EOL> from graphql . core . type import ( GraphQLArgument , GraphQLField , <EOL> GraphQLInputObjectField , GraphQLInputObjectType , <EOL> GraphQLList , GraphQLNonNull , GraphQLObjectType , <EOL> GraphQLScalarType , GraphQLSchema , GraphQLString ) <EOL> TestComplexScalar = GraphQLScalarType ( <EOL> name = '<STR_LIT>' , <EOL> serialize = lambda v : '<STR_LIT>' if v == '<STR_LIT>' else None , <EOL> parse_value = lambda v : '<STR_LIT>' if v == '<STR_LIT>' else None , <EOL> parse_literal = lambda v : '<STR_LIT>' if v . value == '<STR_LIT>' else None <EOL> ) <EOL> TestInputObject = GraphQLInputObjectType ( '<STR_LIT>' , { <EOL> '<STR_LIT:a>' : GraphQLInputObjectField ( GraphQLString ) , <EOL> '<STR_LIT:b>' : GraphQLInputObjectField ( GraphQLList ( GraphQLString ) ) , <EOL> '<STR_LIT:c>' : GraphQLInputObjectField ( GraphQLNonNull ( GraphQLString ) ) , <EOL> '<STR_LIT:d>' : GraphQLInputObjectField ( TestComplexScalar ) <EOL> } ) <EOL> stringify = lambda obj : json . dumps ( obj , sort_keys = True ) <EOL> def input_to_json ( obj , args , info ) : <EOL> input = args . get ( '<STR_LIT:input>' ) <EOL> if input : <EOL> return stringify ( input ) <EOL> TestNestedInputObject = GraphQLInputObjectType ( <EOL> name = '<STR_LIT>' , <EOL> fields = { <EOL> '<STR_LIT>' : GraphQLInputObjectField ( GraphQLNonNull ( TestInputObject ) ) , <EOL> '<STR_LIT>' : GraphQLInputObjectField ( GraphQLNonNull ( GraphQLString ) ) <EOL> } <EOL> ) <EOL> TestType = GraphQLObjectType ( '<STR_LIT>' , { <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( TestInputObject ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( GraphQLString ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( GraphQLNonNull ( GraphQLString ) ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( GraphQLString , '<STR_LIT>' ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( TestNestedInputObject , '<STR_LIT>' ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT:list>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( GraphQLList ( GraphQLString ) ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( <EOL> GraphQLNonNull ( GraphQLList ( GraphQLString ) ) <EOL> ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( <EOL> GraphQLList ( GraphQLNonNull ( GraphQLString ) ) <EOL> ) } , <EOL> resolver = input_to_json ) , <EOL> '<STR_LIT>' : GraphQLField ( <EOL> GraphQLString , <EOL> args = { '<STR_LIT:input>' : GraphQLArgument ( <EOL> GraphQLNonNull ( GraphQLList ( GraphQLNonNull ( GraphQLString ) ) ) <EOL> ) } , <EOL> resolver = input_to_json ) , <EOL> } ) <EOL> schema = GraphQLSchema ( TestType ) <EOL> def check ( doc , expected , args = None ) : <EOL> ast = parse ( doc ) <EOL> response = execute ( schema , None , ast , args = args ) <EOL> if response . errors : <EOL> result = { <EOL> '<STR_LIT:data>' : response . data , <EOL> '<STR_LIT>' : [ format_error ( e ) for e in response . errors ] <EOL> } <EOL> else : <EOL> result = { <EOL> '<STR_LIT:data>' : response . data <EOL> } <EOL> assert result == expected <EOL> def test_inline_executes_with_complex_input ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { "<STR_LIT>" : stringify ( { "<STR_LIT:a>" : "<STR_LIT:foo>" , "<STR_LIT:b>" : [ "<STR_LIT:bar>" ] , "<STR_LIT:c>" : "<STR_LIT>" } ) } <EOL> } ) <EOL> def test_properly_parses_single_value_to_list ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : stringify ( { "<STR_LIT:a>" : "<STR_LIT:foo>" , "<STR_LIT:b>" : [ "<STR_LIT:bar>" ] , "<STR_LIT:c>" : "<STR_LIT>" } ) } <EOL> } ) <EOL> def test_does_not_use_incorrect_value ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : None } <EOL> } ) <EOL> class TestUsingVariables : <EOL> doc = '''<STR_LIT>''' <EOL> def test_executes_with_complex_input ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : [ '<STR_LIT:bar>' ] , '<STR_LIT:c>' : '<STR_LIT>' } } <EOL> check ( self . doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : stringify ( { "<STR_LIT:a>" : "<STR_LIT:foo>" , "<STR_LIT:b>" : [ "<STR_LIT:bar>" ] , "<STR_LIT:c>" : "<STR_LIT>" } ) } <EOL> } , params ) <EOL> def test_uses_default_value_when_not_provided ( self ) : <EOL> with_defaults_doc = '''<STR_LIT>''' <EOL> check ( with_defaults_doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : stringify ( { "<STR_LIT:a>" : "<STR_LIT:foo>" , "<STR_LIT:b>" : [ "<STR_LIT:bar>" ] , "<STR_LIT:c>" : "<STR_LIT>" } ) } <EOL> } ) <EOL> def test_properly_parses_single_value_to_list ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : '<STR_LIT:bar>' , '<STR_LIT:c>' : '<STR_LIT>' } } <EOL> check ( self . doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : stringify ( { "<STR_LIT:a>" : "<STR_LIT:foo>" , "<STR_LIT:b>" : [ "<STR_LIT:bar>" ] , "<STR_LIT:c>" : "<STR_LIT>" } ) } <EOL> } , params ) <EOL> def test_executes_with_complex_scalar_input ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:c>' : '<STR_LIT:foo>' , '<STR_LIT:d>' : '<STR_LIT>' } } <EOL> check ( self . doc , { <EOL> '<STR_LIT:data>' : { '<STR_LIT>' : stringify ( { "<STR_LIT:c>" : "<STR_LIT:foo>" , "<STR_LIT:d>" : "<STR_LIT>" } ) } <EOL> } , params ) <EOL> def test_errors_on_null_for_nested_non_null ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : '<STR_LIT:bar>' , '<STR_LIT:c>' : None } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( self . doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_errors_on_incorrect_type ( self ) : <EOL> params = { '<STR_LIT:input>' : '<STR_LIT>' } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( self . doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_errors_on_omission_of_nested_non_null ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : '<STR_LIT:bar>' } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( self . doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_errors_on_deep_nested_errors_and_with_many_errors ( self ) : <EOL> nested_doc = '''<STR_LIT>''' <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' } } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( nested_doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_errors_on_addition_of_input_field_of_incorrect_type ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : '<STR_LIT:bar>' , '<STR_LIT:c>' : '<STR_LIT>' , '<STR_LIT:d>' : '<STR_LIT>' } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( self . doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_errors_on_addition_of_unknown_input_field ( self ) : <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:a>' : '<STR_LIT:foo>' , '<STR_LIT:b>' : '<STR_LIT:bar>' , '<STR_LIT:c>' : '<STR_LIT>' , '<STR_LIT>' : '<STR_LIT>' } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( self . doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_allows_nullable_inputs_to_be_omitted ( ) : <EOL> doc = '<STR_LIT>' <EOL> check ( doc , { '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } } ) <EOL> def test_allows_nullable_inputs_to_be_omitted_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } <EOL> } ) <EOL> def test_allows_nullable_inputs_to_be_omitted_in_an_unlisted_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } <EOL> } ) <EOL> def test_allows_nullable_inputs_to_be_set_to_null_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } <EOL> } , { '<STR_LIT:value>' : None } ) <EOL> def test_allows_nullable_inputs_to_be_set_to_a_value_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } , { '<STR_LIT:value>' : '<STR_LIT:a>' } ) <EOL> def test_allows_nullable_inputs_to_be_set_to_a_value_directly ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) <EOL> def test_does_not_allow_non_nullable_inputs_to_be_omitted_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> def test_does_not_allow_non_nullable_inputs_to_be_set_to_null_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , { '<STR_LIT:value>' : None } ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> def test_allows_non_nullable_inputs_to_be_set_to_a_value_in_a_variable ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } , { '<STR_LIT:value>' : '<STR_LIT:a>' } ) <EOL> def test_allows_non_nullable_inputs_to_be_set_to_a_value_directly ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) <EOL> def test_passes_along_null_for_non_nullable_inputs_if_explcitly_set_in_the_query ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } <EOL> } ) <EOL> def test_allows_lists_to_be_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT:list>' : None <EOL> } <EOL> } ) <EOL> def test_allows_lists_to_contain_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT:list>' : stringify ( [ '<STR_LIT:A>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' ] } ) <EOL> def test_allows_lists_to_contain_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT:list>' : stringify ( [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] } ) <EOL> def test_does_not_allow_non_null_lists_to_be_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , { '<STR_LIT:input>' : None } ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> def test_allows_non_null_lists_to_contain_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : stringify ( [ '<STR_LIT:A>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' ] } ) <EOL> def test_allows_non_null_lists_to_contain_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : stringify ( [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] } ) <EOL> def test_allows_lists_of_non_nulls_to_be_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : None <EOL> } <EOL> } , { '<STR_LIT:input>' : None } ) <EOL> def test_allows_lists_of_non_nulls_to_contain_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : stringify ( [ '<STR_LIT:A>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' ] } ) <EOL> def test_does_not_allow_lists_of_non_nulls_to_contain_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> params = { '<STR_LIT:input>' : [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_does_not_allow_non_null_lists_of_non_nulls_to_be_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , { '<STR_LIT:input>' : None } ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> def test_allows_non_null_lists_of_non_nulls_to_contain_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> check ( doc , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : stringify ( [ '<STR_LIT:A>' ] ) <EOL> } <EOL> } , { '<STR_LIT:input>' : [ '<STR_LIT:A>' ] } ) <EOL> def test_does_not_allow_non_null_lists_of_non_nulls_to_contain_null ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> params = { '<STR_LIT:input>' : [ '<STR_LIT:A>' , None , '<STR_LIT:B>' ] } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> '<STR_LIT>' . format ( stringify ( params [ '<STR_LIT:input>' ] ) ) <EOL> } <EOL> def test_does_not_allow_invalid_types_to_be_used_as_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> params = { '<STR_LIT:input>' : { '<STR_LIT:list>' : [ '<STR_LIT:A>' , '<STR_LIT:B>' ] } } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> def test_does_not_allow_unknown_types_to_be_used_as_values ( ) : <EOL> doc = '''<STR_LIT>''' <EOL> params = { '<STR_LIT:input>' : '<STR_LIT>' } <EOL> with raises ( GraphQLError ) as excinfo : <EOL> check ( doc , { } , params ) <EOL> assert format_error ( excinfo . value ) == { <EOL> '<STR_LIT>' : [ { '<STR_LIT>' : <NUM_LIT> , '<STR_LIT>' : <NUM_LIT:2> } ] , <EOL> '<STR_LIT:message>' : '<STR_LIT>' <EOL> } <EOL> class TestUsesArgumentDefaultValues : <EOL> def test_when_no_argument_provided ( self ) : <EOL> check ( '<STR_LIT>' , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) <EOL> def test_when_nullable_variable_provided ( self ) : <EOL> check ( '''<STR_LIT>''' , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) <EOL> def test_when_argument_provided_cannot_be_parsed ( self ) : <EOL> check ( '''<STR_LIT>''' , { <EOL> '<STR_LIT:data>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) </s>
