Exemplo n.º 1
0
def test_link_interpolate_args_identity(schema, session):
    class C(object):
        def identity(self):
            return "my-app"

    link = Service(schema, session).app.delete
    assert link.interpolate_args([C()]) == 'https://api.heroku.com/apps/my-app'
Exemplo n.º 2
0
def test_link_interpolate_args_too_few(schema, session):
    link = Service(schema, session).app.delete
    with pytest.raises(TypeError):
        link.interpolate_args([])
Exemplo n.º 3
0
def test_link_interpolate_args(schema, session):
    link = Service(schema, session).app.delete
    assert link.interpolate_args(['my-app']) == 'https://api.heroku.com/apps/my-app'
Exemplo n.º 4
0
def test_link_interpolate_args_too_many(schema, session):
    link = Service(schema, session).app.delete
    with pytest.raises(TypeError):
        link.interpolate_args(['foo', 'bar'])