2023-02-13 19:41:57 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# coding: utf-8
|
|
|
|
|
|
|
|
|
|
import pathlib
|
|
|
|
|
import sys
|
|
|
|
|
import unittest
|
|
|
|
|
|
|
|
|
|
from tornado.testing import AsyncHTTPTestCase
|
|
|
|
|
|
|
|
|
|
sys.path.append(pathlib.Path(__file__).parent.parent.as_posix())
|
|
|
|
|
from server import RunServer
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class YYeTsTest(AsyncHTTPTestCase):
|
|
|
|
|
def get_app(self):
|
|
|
|
|
return RunServer.application
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class TestIndex(YYeTsTest):
|
|
|
|
|
def test_homepage(self):
|
2023-03-19 17:35:39 +01:00
|
|
|
response = self.fetch("/")
|
2023-02-13 19:41:57 +01:00
|
|
|
self.assertEqual(response.code, 200)
|
2023-03-19 17:35:39 +01:00
|
|
|
self.assertTrue(b"<!doctype html>" in response.body)
|
2023-02-13 19:41:57 +01:00
|
|
|
|
|
|
|
|
|
2023-03-19 17:35:39 +01:00
|
|
|
if __name__ == "__main__":
|
2023-02-13 19:41:57 +01:00
|
|
|
unittest.main()
|