annotate tests/test_ttw.txt @ 61:53ec5144f84f

start serving PyPI
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 01 Mar 2012 15:59:18 -0800
parents 46f5fd27ee54
children 7c154953acc4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
60
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
1 Test Through The Web
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
2 ====================
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
3
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
4 Test ``simpypi`` through the web with a test server.
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
5
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
6 The obligatory imports::
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
7
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
8 >>> from simpypi.factory import factory
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
9
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
10 Create a WSGI app::
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
11
46f5fd27ee54 stub testing TTW
Jeff Hammel <jhammel@mozilla.com>
parents:
diff changeset
12 >>> app = factory(directory=directory)
61
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
13
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
14 Now wrap it in a server::
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
15
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
16 >>> server = testserver(app, 'localhost', 64321)
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
17 >>> server.start()
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
18
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
19 Shut down the server::
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
20
53ec5144f84f start serving PyPI
Jeff Hammel <jhammel@mozilla.com>
parents: 60
diff changeset
21 >>> server.stop()