Commits

Mariano Mara committed 540b451

Attribute urlargs from webob.request with complete test coverage (set,get,delete)

  • Participants
  • Parent commits 3c60459

Comments (0)

Files changed (1)

File tests/test_request.py

     eq_(a.path_info_peek(), None)
     eq_(a.path_info_pop(), None)
 
-def test_urlvars_set_del():
+def test_urlvars_property():
     """
     Testing urlvars setter/getter/deleter
     """
     del a.urlvars
     ok_('paste.urlvars' not in a.environ)
 
+def test_urlargs_property():
+    """
+    Testing urlargs setter/getter/deleter
+    """
+    a = Request({'paste.urlvars':{'test':'value'}})
+    eq_(a.urlargs, ())
+    a.urlargs = {'hello':'world'}
+    eq_(a.environ['wsgiorg.routing_args'], ({'hello':'world'},
+                                            {'test':'value'}))
+    a = Request({'a':1})
+    a.urlargs = {'hello':'world'}
+    eq_(a.environ['wsgiorg.routing_args'], ({'hello':'world'}, {}))
+    del a.urlargs
+    ok_('wsgiorg.routing_args' not in a.environ)
+
+
+