title: How to run python unit tests in google app engine
body: <p>I'm fairly new to google app engine and python so please bear with me.
  I'm trying to run a python unit test on gae for first time while following the guide at <a href="http://webapp-improved.appspot.com/guide/testing.html?highlight=unittest" rel="nofollow">Webapp2</a></p>
  
  <p>But when I run the test I keep getting the following error :</p>
  
  <pre><code>Traceback (most recent call last):
    File "test.py", line 2, in &lt;module&gt;
      import webapp2
  ImportError: No module named webapp2
  </code></pre>
  
  <p>This is my test.py file:</p>
  
  <pre><code>import unittest
  import webapp2
  
  # from the app main.py
  import main
  
  class TestHandlers(unittest.TestCase):
     def test_hello(self):
         # Build a request object passing the URI path to be tested.
         # You can also pass headers, query arguments etc.
         request = webapp2.Request.blank('/')
         # Get a response for that request.
         response = request.get_response(main.app)
  
         # Let's check if the response is correct.
         self.assertEqual(response.status_int, 200)
         self.assertEqual(response.body, 'Hello, world!')
  
  if __name__ == '__main__':
      unittest.main()
  </code></pre>
  
  <p><strong>This is my main.py file:</strong></p>
  
  <pre><code>import webapp2
  
  class HelloHandler(webapp2.RequestHandler):
      def get(self):
          self.response.write('Hello, world!')
  
  app = webapp2.WSGIApplication([('/', HelloHandler)])
  
  def main():
      app.run()
  
  if __name__ == '__main__':
      main()
  </code></pre>
  
  <p><strong>This is my app.yaml file:</strong></p>
  
  <pre><code>application: test-app
  version: 1
  runtime: python27
  api_version: 1
  threadsafe: true
  
  - url: /.*
    script: main.app
  
  libraries:
  - name: jinja2
    version: latest
  
  builtins:
  - remote_api: on
  </code></pre>
  
  <p>My current folder structure is:</p>
  
  <pre><code>Test-app
           app.yaml
           main.py
           test.py
           index.yaml
  </code></pre>
  
  <p>And to run the test I'm doing:</p>
  
  <pre><code>$ cd test-app
  $ python test.py
  </code></pre>
  
  <p>Can anyone point me in the write direction, on why am I getting the error message above and why can't I run this simple test.</p>
  
  <p>I've tried to post as much info as i could, hope will be enough, for someone to give me a little hand.</p>
  
  <p>Thanks.</p>