def test_NestedParameter_nullname(self): # same as above except "p1" and "any" are skipped fields = [ NestedParameter(name="inner", fields=[ StringParameter(name='str'), AnyPropertyParameter(name='') ]), IntParameter(name="foo"), NestedParameter(name='bar', fields=[ NestedParameter( name='', fields=[AnyPropertyParameter(name='a')]), NestedParameter( name='', fields=[AnyPropertyParameter(name='b')]) ]) ] self.do_ParameterTest(req=dict(foo='123', inner_str="bar", inner_name="hello", inner_value="world", reason="because", bar_a_name="a", bar_a_value="7", bar_b_name="b", bar_b_value="8"), expect=dict(foo=123, inner=dict(str="bar", hello="world"), bar={'a': '7', 'b': '8'}), expectKind=dict, klass=NestedParameter, fields=fields, name='')
def test_NestedNestedParameter(self): fields = [ NestedParameter(name="inner", fields=[ StringParameter(name='str'), AnyPropertyParameter(name='any') ]), IntParameter(name="foo") ] self.do_ParameterTest(req=dict(p1_foo='123', p1_inner_str="bar", p1_inner_any_name="hello", p1_inner_any_value="world", reason="because"), expect=dict(foo=123, inner=dict(str="bar", hello="world")), klass=NestedParameter, fields=fields)