Hi All, I'm new to python & webpy, and am trying to get a simple unit
test running. I have separated the test and application code into two
modules. Running the unit test gives me a 405 (Method not allowed).
Surprisingly, if I put a breakpoint in GET or a print statement, GET
is never getting called. Somewhere the trolley is going off the
tracks, but I don't know where. Also, in Eclipse,

Any help is gratefully appreciated.

========
foo.py:
========
import web

urls = ('/foo/(.*)', 'foo')
app = web.application(urls, globals())

class foo():

    def GET(self):
        return "foo"

if __name__ == "__main__": app.run()

=======
testFoo.py
=======
import unittest
from foo import app

class TestFoo(unittest.TestCase):

    def testFooGet(self):
        url = '/foo/1234'
        response = app.request('GET', url)                 # in
Eclipse, this line gives me "undefined variable from import: request"
        self.assertEquals(response.status, '200 OK')

if __name__ == "__main__":
    unittest.main()

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to