Mercurial > hg > simpypi
view tests/doctest.txt @ 38:ee29001674af
begin to make a temporary copy (though itd be better to work in memory, ideally)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Thu, 01 Mar 2012 10:02:31 -0800 |
parents | 1bdece293671 |
children | 089d5650d7e2 |
line wrap: on
line source
Test simpypi ============ The obligatory imports:: >>> import os >>> import simpypi >>> from paste.fixture import TestApp The directory is initially empty:: >>> os.listdir(directory) [] Make a test application:: >>> app = simpypi.SimPyPI(directory) >>> testapp = TestApp(app) Upload a package:: >>> field = 'package' >>> filename = 'HelloWorld-0.0.tar.gz' >>> contents = file(os.path.join(here, filename)).read() >>> response = testapp.post('/', upload_files=[(field, filename, contents)])