Skip to main content

Provides simple classes to be used for unit testing PythonScript and FSPythonScripts from Zope / Plone.

Project description

Provides simple classes to be used for unit testing PythonScript and FSPythonScripts from Zope / Plone.

Uses the bare minimum of setup code and does not require Zope or Plone to run.

Example usage

>>> from isotoma.zope.testpythonscript import PythonScript
>>> my_script = """## Script to output stuff given to it
... ##bind container=container
... ##bind context=context
... ##bind namespace=namespace
... ##bind script=script
... ##bind state=state
... ##bind traverse_subpath=traverse_subpath
... ##parameters=name=None
... ##title=
... ##
... return 'Hello world! Hello %s!' % name
... """
>>> py_script = PythonScript(my_script, 'my_script')
>>> py_script(name='Foo')
'Hello world! Hello Foo'
>>>

See the documentation of isotoma.zope.testpythonscript.script for full details of the class and of FSPythonScript.

See isotoma.zope.testpythonscript.tests.test_script for more examples.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

isotoma.zope.testpythonscript-1.0.0.tar.gz (4.7 kB view details)

Uploaded Source

File details

Details for the file isotoma.zope.testpythonscript-1.0.0.tar.gz.

File metadata

File hashes

Hashes for isotoma.zope.testpythonscript-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7180ee40b69ec1452cda69d95ef4e7278e0d5fad67867bb06aa85792ce533196
MD5 0b3bbd235215e197014cfb2997c1b543
BLAKE2b-256 be1a00ccf94b2c29fc4a28475871043fc8894355e1365772daf5a4e38ef02052

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page