Package cherrypy :: Package test :: Module webtest :: Class WebCase
[hide private]
[frames] | no frames]

Class WebCase

source code

       object --+    
                |    
unittest.TestCase --+
                    |
                   WebCase
Known Subclasses:
helper.CPWebCase

Nested Classes [hide private]
  HTTP_CONN

Inherited from unittest.TestCase: failureException

Instance Methods [hide private]
 
set_persistent(self, on=True, auto_open=False)
Make our HTTP_CONN persistent (or not).
source code
 
_get_persistent(self) source code
 
_set_persistent(self, on=True) source code
 
getPage(self, url, headers=None, method='GET', body=None, protocol=None)
Open the url with debugging support.
source code
 
_handlewebError(self, msg) source code
 
exit(self) source code
 
__call__(self, result=None) source code
 
assertStatus(self, status, msg=None)
Fail if self.status != status.
source code
 
assertHeader(self, key, value=None, msg=None)
Fail if (key, [value]) not in self.headers.
source code
 
assertNoHeader(self, key, msg=None)
Fail if key in self.headers.
source code
 
assertBody(self, value, msg=None)
Fail if value != self.body.
source code
 
assertInBody(self, value, msg=None)
Fail if value not in self.body.
source code
 
assertNotInBody(self, value, msg=None)
Fail if value in self.body.
source code
 
assertMatchesBody(self, pattern, msg=None, flags=0)
Fail if value (a regex pattern) is not in self.body.
source code

Inherited from unittest.TestCase: __init__, __repr__, __str__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, setUp, shortDescription, tearDown

Inherited from unittest.TestCase (private): _exc_info

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Class Variables [hide private]
  HOST = '127.0.0.1'
  PORT = 8000
  PROTOCOL = 'HTTP/1.1'
  interactive = True
  console_height = 30
Properties [hide private]
  persistent

Inherited from object: __class__

Method Details [hide private]

set_persistent(self, on=True, auto_open=False)

source code 

Make our HTTP_CONN persistent (or not).

If the 'on' argument is True (the default), then self.HTTP_CONN will be set to an instance of httplib.HTTPConnection (or HTTPS if self.scheme is "https"). This will then persist across requests.

We only allow for a single open connection, so if you call this and we currently have an open connection, it will be closed.

getPage(self, url, headers=None, method='GET', body=None, protocol=None)

source code 
Open the url with debugging support. Return status, headers, body.

__call__(self, result=None)
(Call operator)

source code 
Overrides: unittest.TestCase.__call__

Property Details [hide private]

persistent

Get Method:
cherrypy.test.webtest.WebCase._get_persistent(self)
Set Method:
cherrypy.test.webtest.WebCase._set_persistent(self, on=True)