From 47103b76a475a32b86ab4a1946d466059c1c9928 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Fri, 30 Nov 2012 21:17:16 -0600 Subject: [PATCH] Add test for the milla.allow decorator --- src/milla/tests/test_app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/milla/tests/test_app.py b/src/milla/tests/test_app.py index 1376e20..7afefa0 100644 --- a/src/milla/tests/test_app.py +++ b/src/milla/tests/test_app.py @@ -394,3 +394,12 @@ def test_single_start_response(): assert start_response.call_count == 1, start_response.call_count assert response.headers.startswith('HTTP/1.1 200 OK'), response.headers assert response.body == 'test', response.body + +def test_allow_decorator(): + '''Ensure allow decorator sets allowed_methods on controllers''' + + @milla.allow('GET', 'HEAD', 'POST') + def controller(request): + return 'success' + + assert controller.allowed_methods == ('GET', 'HEAD', 'POST')