annotate 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
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'