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

Type WebCase

object --+    
         |    
  TestCase --+
             |
            WebCase

Known Subclasses:
CPWebCase

Method Summary
  __call__(self, result)
  assertBody(self, value, msg)
Fail if value != self.body.
  assertHeader(self, key, value, msg)
Fail if (key, [value]) not in self.headers.
  assertInBody(self, value, msg)
Fail if value not in self.body.
  assertMatchesBody(self, pattern, msg, flags)
Fail if value (a regex pattern) is not in self.body.
  assertNoHeader(self, key, msg)
Fail if key in self.headers.
  assertNotInBody(self, value, msg)
Fail if value in self.body.
  assertStatus(self, status, msg)
Fail if self.status != status.
  exit(self)
  getPage(self, url, headers, method, body, protocol)
Open the url with debugging support.
  set_persistent(self, on, auto_open)
Make our HTTP_CONN persistent (or not).
    Inherited from TestCase
  __init__(self, methodName)
Create an instance of the class that will use the named test method when executed.
  __repr__(self)
  __str__(self)
  assert_(self, expr, msg)
Fail the test unless the expression is true.
  assertAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertAlmostEquals(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertEquals(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  assertFalse(self, expr, msg)
Fail the test if the expression is true.
  assertNotAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotAlmostEquals(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  assertNotEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertNotEquals(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  assertRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  assertTrue(self, expr, msg)
Fail the test unless the expression is true.
  countTestCases(self)
  debug(self)
Run the test without collecting errors in a TestResult
  defaultTestResult(self)
  fail(self, msg)
Fail immediately, with the given message.
  failIf(self, expr, msg)
Fail the test if the expression is true.
  failIfAlmostEqual(self, first, second, places, msg)
Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failIfEqual(self, first, second, msg)
Fail if the two objects are equal as determined by the '==' operator.
  failUnless(self, expr, msg)
Fail the test unless the expression is true.
  failUnlessAlmostEqual(self, first, second, places, msg)
Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero.
  failUnlessEqual(self, first, second, msg)
Fail if the two objects are unequal as determined by the '==' operator.
  failUnlessRaises(self, excClass, callableObj, *args, **kwargs)
Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs.
  id(self)
  run(self, result)
  setUp(self)
Hook method for setting up the test fixture before exercising it.
  shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.
  tearDown(self)
Hook method for deconstructing the test fixture after testing it.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value

Property Summary
  persistent

Class Variable Summary
int console_height = 30                                                                    
str HOST = '127.0.0.1'
classobj HTTP_CONN = httplib.HTTPConnection
bool interactive = True
int PORT = 8000                                                                  
str PROTOCOL = 'HTTP/1.1'

Method Details

assertBody(self, value, msg=None)

Fail if value != self.body.

assertHeader(self, key, value=None, msg=None)

Fail if (key, [value]) not in self.headers.

assertInBody(self, value, msg=None)

Fail if value not in self.body.

assertMatchesBody(self, pattern, msg=None, flags=0)

Fail if value (a regex pattern) is not in self.body.

assertNoHeader(self, key, msg=None)

Fail if key in self.headers.

assertNotInBody(self, value, msg=None)

Fail if value in self.body.

assertStatus(self, status, msg=None)

Fail if self.status != status.

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

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

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

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.

Class Variable Details

console_height

Type:
int
Value:
30                                                                    

HOST

Type:
str
Value:
'127.0.0.1'                                                            

interactive

Type:
bool
Value:
True                                                                   

PORT

Type:
int
Value:
8000                                                                  

PROTOCOL

Type:
str
Value:
'HTTP/1.1'                                                             

Generated by Epydoc 2.1 on Thu Jul 19 15:32:17 2007 http://epydoc.sf.net