~kernevil/ubuntu/saucy/pylons/fix-useless-import

« back to all changes in this revision

Viewing changes to tests/test_units/test_xmlrpc.py

  • Committer: Bazaar Package Importer
  • Author(s): Piotr Ożarowski
  • Date: 2011-08-02 21:17:36 UTC
  • mfrom: (1.2.3 upstream) (10.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20110802211736-ejqil9b3yqgxt6lr
Tags: 1.0-2
* Add ipython_0.11_compatibility patch (thanks to Julian Taylor)
* Add build-arch and build-indep targets to debian/rules 
* Switch from dh_pysupport to dh_python2
* Source format changed to 3.0 (quilt)
* Standards-Version bumped to 3.9.2 (no changes needed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import pylons
6
6
from pylons.util import ContextObj
7
7
from pylons.controllers import XMLRPCController
 
8
import webob.exc as exc
8
9
import xmlrpclib
9
10
 
10
11
from __init__ import TestWSGIController, SetupCacheGlobal, ControllerWrap
11
12
 
12
13
class BaseXMLRPCController(XMLRPCController):
 
14
    def __init__(self):
 
15
        self._pylons_log_debug = True
 
16
    
13
17
    foo = 'bar'
14
18
    
15
19
    def userstatus(self):
96
100
        data = xmlrpclib.dumps((), methodname=u'ОбсуждениеКомпаний')
97
101
        self.response = response = self.app.post('/', params=data, extra_environ=dict(CONTENT_TYPE='text/xml'))
98
102
    
 
103
    def test_no_length(self):
 
104
        data = xmlrpclib.dumps((), methodname=u'ОбсуждениеКомпаний')
 
105
        self.assertRaises(exc.HTTPLengthRequired, lambda: self.app.post('/', extra_environ=dict(CONTENT_LENGTH='')))
 
106
    
 
107
    def test_too_big(self):
 
108
        data = xmlrpclib.dumps((), methodname=u'ОбсуждениеКомпаний')
 
109
        self.assertRaises(exc.HTTPRequestEntityTooLarge, lambda: self.app.post('/', extra_environ=dict(CONTENT_LENGTH='4194314')))
 
110
    
99
111
    def test_badargs(self):
100
112
        self.assertRaises(xmlrpclib.Fault, self.xmlreq, 'system.methodHelp')
101
113