Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import pytest
  2. import tornado
  3. from tornado.testing import AsyncTestCase
  4. from tornado.httpclient import AsyncHTTPClient
  5. from tornado.web import Application, RequestHandler
  6. import urllib.parse
  7.  
  8.  
  9. class TestRESTAuthHandler(AsyncTestCase):
  10. @tornado.testing.gen_test
  11. def test_http_fetch_login(self):
  12. data = urllib.parse.urlencode(dict(username='admin', password='123456'))
  13. client = AsyncHTTPClient(self.io_loop)
  14. response = yield client.fetch("http://localhost:8080//#/login", method="POST", body=data)
  15. # Test contents of response
  16. self.assertIn("Automation web console", response.body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement