예제 #1
0
def test_make_default_urls():
    app = Pantam()
    assert app.make_url("index", "fetch_all") == "/"
    assert app.make_url("index", "fetch_single") == "/{id}"
    assert app.make_url("index", "create") == "/"
    assert app.make_url("index", "update") == "/{id}"
    assert app.make_url("index", "delete") == "/{id}"
예제 #2
0
def test_make_custom_resource_urls():
    app = Pantam()
    assert app.make_url("custom-action", "fetch_all") == "/custom-action/"
    assert app.make_url("custom-action",
                        "fetch_single") == "/custom-action/{id}"
    assert app.make_url("custom-action", "create") == "/custom-action/"
    assert app.make_url("custom-action", "update") == "/custom-action/{id}"
    assert app.make_url("custom-action", "delete") == "/custom-action/{id}"
예제 #3
0
def test_make_custom_method_urls():
    app = Pantam()
    assert app.make_url("index",
                        "get_my_custom_method") == "/my-custom-method/"
    assert app.make_url("foo",
                        "set_your_magic_method") == "/foo/your-magic-method/"