Skip to content

Commit

Permalink
remove unneeded stuf
Browse files Browse the repository at this point in the history
  • Loading branch information
philikon committed Jul 29, 2008
1 parent 0945a14 commit c73c541
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions src/grokcore/formlib/ftests/test_grok_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from pkg_resources import resource_listdir
from zope.testing import doctest, renormalizing
from zope.app.testing.functional import (HTTPCaller, getRootFolder,
FunctionalTestSetup, sync, ZCMLLayer)
from zope.app.testing.functional import (getRootFolder, FunctionalTestSetup,
ZCMLLayer)

ftesting_zcml = os.path.join(os.path.dirname(grokcore.formlib.__file__),
'ftesting.zcml')
Expand All @@ -24,25 +24,6 @@ def tearDown(test):
(re.compile(r'httperror_seek_wrapper:', re.M), 'HTTPError:'),
])

def http_call(method, path, data=None, **kw):
"""Function to help make RESTful calls.
method - HTTP method to use
path - testbrowser style path
data - (body) data to submit
kw - any request parameters
"""

if path.startswith('http://localhost'):
path = path[len('http://localhost'):]
request_string = '%s %s HTTP/1.1\n' % (method, path)
for key, value in kw.items():
request_string += '%s: %s\n' % (key, value)
if data is not None:
request_string += '\r\n'
request_string += data
return HTTPCaller()(request_string, handle_errors=False)

def suiteFromPackage(name):
files = resource_listdir(__name__, name)
suite = unittest.TestSuite()
Expand All @@ -56,10 +37,7 @@ def suiteFromPackage(name):
test = doctest.DocTestSuite(
dottedname, setUp=setUp, tearDown=tearDown,
checker=checker,
extraglobs=dict(http=HTTPCaller(),
http_call=http_call,
getRootFolder=getRootFolder,
sync=sync),
extraglobs=dict(getRootFolder=getRootFolder),
optionflags=(doctest.ELLIPSIS+
doctest.NORMALIZE_WHITESPACE+
doctest.REPORT_NDIFF)
Expand Down

0 comments on commit c73c541

Please sign in to comment.