def test_link_construct_body_patternProperties(schema, session): link = Service(schema, session).config_var.update body = link.construct_body({'PIZZA_CRUST': 'thin'}) assert json.loads(body) == {'PIZZA_CRUST': 'thin'}
def test_link_construct_body_missing_required_arg(schema, session): link = Service(schema, session).app.create link._link['schema']['required'] = ['stack'] with pytest.raises(TypeError): link.construct_body({})
def test_link_construct_body_no_body(schema, session): link = Service(schema, session).app.delete assert link.construct_body({}) is None with pytest.raises(TypeError): link.construct_body({'bad': 'arg'})
def test_link_construct_body_unexpected_arg(schema, session): link = Service(schema, session).app.create with pytest.raises(TypeError): link.construct_body({'stack': 'cedar', 'bad': 'arg'})
def test_link_construct_body(schema, session): link = Service(schema, session).app.create body = link.construct_body({'stack': 'cedar'}) assert json.loads(body) == {'stack': 'cedar'}