예제 #1
0
파일: test_link.py 프로젝트: jacobian/valor
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'}
예제 #2
0
파일: test_link.py 프로젝트: jacobian/valor
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({})
예제 #3
0
파일: test_link.py 프로젝트: jacobian/valor
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'})
예제 #4
0
파일: test_link.py 프로젝트: jacobian/valor
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'})
예제 #5
0
파일: test_link.py 프로젝트: jacobian/valor
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'}