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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Test pyloader's Factory
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 =======================
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 Boilerplate::
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 >>> import os
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7 >>> from pyloader.factory import PyFactory
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9 Construct a factory::
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11 >>> factory = PyFactory()
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
13 Make a configuration::
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
14
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
15 >>> config = {'': {'path': os.path.join(here, 'objects.py:stringsort'), 'args': ['foo', 'bar']}}
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
16
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
17 Load it::
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
18
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
19 >>> factory.configure(config)
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
20
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
21 Get the thing::
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
22
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
23 >>> factory.load()
ff272dcd5cd8 we have a passing test
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
24 'abfoor'