Mercurial > hg > pyloader
view tests/test_factory.txt @ 11:ff272dcd5cd8
we have a passing test
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 27 May 2011 07:02:27 -0700 |
parents | |
children | 0bea5297c156 |
line wrap: on
line source
Test pyloader's Factory ======================= Boilerplate:: >>> import os >>> from pyloader.factory import PyFactory Construct a factory:: >>> factory = PyFactory() Make a configuration:: >>> config = {'': {'path': os.path.join(here, 'objects.py:stringsort'), 'args': ['foo', 'bar']}} Load it:: >>> factory.configure(config) Get the thing:: >>> factory.load() 'abfoor'