Mercurial > hg > pyloader
annotate tests/test_factory.txt @ 14:30979d82c95d
remove silly self-reference code for now
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 27 May 2011 18:43:14 -0700 |
parents | ff272dcd5cd8 |
children | 0bea5297c156 |
rev | line source |
---|---|
11 | 1 Test pyloader's Factory |
2 ======================= | |
3 | |
4 Boilerplate:: | |
5 | |
6 >>> import os | |
7 >>> from pyloader.factory import PyFactory | |
8 | |
9 Construct a factory:: | |
10 | |
11 >>> factory = PyFactory() | |
12 | |
13 Make a configuration:: | |
14 | |
15 >>> config = {'': {'path': os.path.join(here, 'objects.py:stringsort'), 'args': ['foo', 'bar']}} | |
16 | |
17 Load it:: | |
18 | |
19 >>> factory.configure(config) | |
20 | |
21 Get the thing:: | |
22 | |
23 >>> factory.load() | |
24 'abfoor' |