utils.py - utilities used by tests¶
Imports¶
These are listed in the order prescribed by PEP 8.
Standard library¶
None.
Third-party imports¶
Local imports¶
None.
Globals¶
Classes¶
Given a dictionary, convert it to an object. For example, if d['one'] == 1
, then after do = DictToObject(d)
, do.one == 1
.
Functions¶
Import from a web2py controller. It returns a object of imported names, which also included standard web2py names (request
, etc.). For example, d = web2py_controller_import('application', 'controller')
then allows d.foo()
, assuming controller
defined a foo()
function.
The runestone_env
fixture.
The controller, as a string.
Note: exec_environment seems like the obvious tool. However, ``exec_environment(‘applications/{}/controllers/{}.py’.format(runestone_controller.request.application, controller)) fails with:
write new testsuite_settings.py into models folder