Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pytest
- import tornado
- from tornado.testing import AsyncTestCase
- from tornado.httpclient import AsyncHTTPClient
- from tornado.web import Application, RequestHandler
- import urllib.parse
- class TestRESTAuthHandler(AsyncTestCase):
- @tornado.testing.gen_test
- def test_http_fetch_login(self):
- data = urllib.parse.urlencode(dict(username='admin', password='123456'))
- client = AsyncHTTPClient(self.io_loop)
- response = yield client.fetch("http://localhost:8080//#/login", method="POST", body=data)
- # Test contents of response
- self.assertIn("Automation web console", response.body)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement