remove all references to tornado
This commit is contained in:
parent
2234812019
commit
b9f4a4be71
2
Pipfile
2
Pipfile
@ -4,10 +4,8 @@ verify_ssl = true
|
||||
name = "pypi"
|
||||
|
||||
[packages]
|
||||
tornado = "*"
|
||||
webassets = "*"
|
||||
Unipath = "*"
|
||||
wtforms-tornado = "*"
|
||||
pendulum = "*"
|
||||
redis = "*"
|
||||
sqlalchemy = "*"
|
||||
|
38
Pipfile.lock
generated
38
Pipfile.lock
generated
@ -1,7 +1,7 @@
|
||||
{
|
||||
"_meta": {
|
||||
"hash": {
|
||||
"sha256": "647d98b5384d1942bbe6bfe7930b1cd249886da2f47645802cd6f93369f44538"
|
||||
"sha256": "2b149e0d8c23814a2c701b53f5c75b36714a2ccd4e2a2769924ef6e2a3f09e97"
|
||||
},
|
||||
"pipfile-spec": 6,
|
||||
"requires": {
|
||||
@ -271,7 +271,6 @@
|
||||
"sha256:1d936da41ee06216d89fdc7ead1ee9a5da2811a8787515a976b646e110c3f622",
|
||||
"sha256:e4ef42e82b0b493c5849eed98b5ab49d6767caf982127e9a33167f1153b36cc5"
|
||||
],
|
||||
"markers": "python_version != '3.0.*' and python_version != '3.1.*' and python_version != '3.2.*' and python_version >= '2.7' and python_version != '3.3.*'",
|
||||
"version": "==2018.5"
|
||||
},
|
||||
"redis": {
|
||||
@ -304,19 +303,6 @@
|
||||
"index": "pypi",
|
||||
"version": "==1.2.10"
|
||||
},
|
||||
"tornado": {
|
||||
"hashes": [
|
||||
"sha256:1c0816fc32b7d31b98781bd8ebc7a9726d7dce67407dc353a2e66e697e138448",
|
||||
"sha256:4f66a2172cb947387193ca4c2c3e19131f1c70fa8be470ddbbd9317fd0801582",
|
||||
"sha256:5327ba1a6c694e0149e7d9126426b3704b1d9d520852a3e4aa9fc8fe989e4046",
|
||||
"sha256:6a7e8657618268bb007646b9eae7661d0b57f13efc94faa33cd2588eae5912c9",
|
||||
"sha256:a9b14804783a1d77c0bd6c66f7a9b1196cbddfbdf8bceb64683c5ae60bd1ec6f",
|
||||
"sha256:c58757e37c4a3172949c99099d4d5106e4d7b63aa0617f9bb24bfbff712c7866",
|
||||
"sha256:d8984742ce86c0855cccecd5c6f54a9f7532c983947cff06f3a0e2115b47f85c"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==5.1"
|
||||
},
|
||||
"unipath": {
|
||||
"hashes": [
|
||||
"sha256:09839adcc72e8a24d4f76d63656f30b5a1f721fc40c9bcd79d8c67bdd8b47dae",
|
||||
@ -353,13 +339,6 @@
|
||||
"sha256:e3ee092c827582c50877cdbd49e9ce6d2c5c1f6561f849b3b068c1b8029626f1"
|
||||
],
|
||||
"version": "==2.2.1"
|
||||
},
|
||||
"wtforms-tornado": {
|
||||
"hashes": [
|
||||
"sha256:dadb5e504d01f14bf75900f592888bb402ada6b8f8235fe583359f562d351a3a"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==0.0.2"
|
||||
}
|
||||
},
|
||||
"develop": {
|
||||
@ -522,7 +501,6 @@
|
||||
"sha256:b9c40e9750f3d77e6e4d441d8b0266cf555e7cdabdcff33c4fd06366ca761ef8",
|
||||
"sha256:ec9ef8f4a9bc6f71eec99e1806bfa2de401650d996c59330782b89a5555c1497"
|
||||
],
|
||||
"markers": "python_version != '3.3.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'",
|
||||
"version": "==4.3.4"
|
||||
},
|
||||
"itsdangerous": {
|
||||
@ -640,7 +618,6 @@
|
||||
"sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1",
|
||||
"sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1"
|
||||
],
|
||||
"markers": "python_version != '3.3.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'",
|
||||
"version": "==0.7.1"
|
||||
},
|
||||
"prompt-toolkit": {
|
||||
@ -663,7 +640,6 @@
|
||||
"sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7",
|
||||
"sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e"
|
||||
],
|
||||
"markers": "python_version != '3.3.*' and python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.0.*' and python_version != '3.2.*'",
|
||||
"version": "==1.5.4"
|
||||
},
|
||||
"pygments": {
|
||||
@ -675,11 +651,11 @@
|
||||
},
|
||||
"pylint": {
|
||||
"hashes": [
|
||||
"sha256:0edfec21270725c5aa8e8d8d06ef5666f766e0e748ed2f1ab23624727303b935",
|
||||
"sha256:4cadcaa4f1fb19123d4baa758d9fbe6286c5b3aa513af6ea42a2d51d405db205"
|
||||
"sha256:1d6d3622c94b4887115fe5204982eee66fdd8a951cf98635ee5caee6ec98c3ec",
|
||||
"sha256:31142f764d2a7cd41df5196f9933b12b7ee55e73ef12204b648ad7e556c119fb"
|
||||
],
|
||||
"index": "pypi",
|
||||
"version": "==2.1.0"
|
||||
"version": "==2.1.1"
|
||||
},
|
||||
"pytest": {
|
||||
"hashes": [
|
||||
@ -713,11 +689,15 @@
|
||||
},
|
||||
"pyyaml": {
|
||||
"hashes": [
|
||||
"sha256:1cbc199009e78f92d9edf554be4fe40fb7b0bef71ba688602a00e97a51909110",
|
||||
"sha256:254bf6fda2b7c651837acb2c718e213df29d531eebf00edb54743d10bcb694eb",
|
||||
"sha256:3108529b78577327d15eec243f0ff348a0640b0c3478d67ad7f5648f93bac3e2",
|
||||
"sha256:3c17fb92c8ba2f525e4b5f7941d850e7a48c3a59b32d331e2502a3cdc6648e76",
|
||||
"sha256:6f89b5c95e93945b597776163403d47af72d243f366bf4622ff08bdfd1c950b7",
|
||||
"sha256:8d6d96001aa7f0a6a4a95e8143225b5d06e41b1131044913fecb8f85a125714b",
|
||||
"sha256:c8a88edd93ee29ede719080b2be6cb2333dfee1dccba213b422a9c8e97f2967b"
|
||||
"sha256:be622cc81696e24d0836ba71f6272a2b5767669b0d79fdcf0295d51ac2e156c8",
|
||||
"sha256:c8a88edd93ee29ede719080b2be6cb2333dfee1dccba213b422a9c8e97f2967b",
|
||||
"sha256:f39411e380e2182ad33be039e8ee5770a5d9efe01a2bfb7ae58d9ba31c4a2a9d"
|
||||
],
|
||||
"version": "==4.2b4"
|
||||
},
|
||||
|
@ -96,7 +96,7 @@ To re-run tests each time a file is changed:
|
||||
|
||||
## Notes
|
||||
|
||||
tornado templates are like mustache templates -- add the
|
||||
Jinja templates are like mustache templates -- add the
|
||||
following to `~/.vim/filetype.vim` for syntax highlighting:
|
||||
|
||||
:au BufRead *.html.to set filetype=mustache
|
||||
|
@ -1,60 +0,0 @@
|
||||
import tornado.gen
|
||||
from tornado.httpclient import AsyncHTTPClient
|
||||
from json import dumps, loads, decoder
|
||||
|
||||
|
||||
class ApiClient(object):
|
||||
def __init__(self, base_url, api_version=None, validate_cert=True):
|
||||
self.base_url = base_url
|
||||
if api_version:
|
||||
self.base_url = f"{base_url}/api/{api_version}"
|
||||
self.client = AsyncHTTPClient()
|
||||
self.validate_cert = validate_cert
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def get(self, path, **kwargs):
|
||||
return (yield self.make_request("GET", self.base_url + path, **kwargs))
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def put(self, path, **kwargs):
|
||||
return (yield self.make_request("PUT", self.base_url + path, **kwargs))
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def post(self, path, **kwargs):
|
||||
return (yield self.make_request("POST", self.base_url + path, **kwargs))
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def patch(self, path, **kwargs):
|
||||
return (yield self.make_request("PATCH", self.base_url + path, **kwargs))
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def delete(self, path, **kwargs):
|
||||
return (yield self.make_request("DELETE", self.base_url + path, **kwargs))
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def make_request(self, method, url, **kwargs):
|
||||
# If 'json' kwarg is specified, serialize it to 'body' and update
|
||||
# the Content-Type.
|
||||
if "json" in kwargs:
|
||||
kwargs["body"] = dumps(kwargs["json"])
|
||||
del kwargs["json"]
|
||||
headers = kwargs.get("headers", {})
|
||||
headers["Content-Type"] = "application/json"
|
||||
kwargs["headers"] = headers
|
||||
if not "validate_cert" in kwargs:
|
||||
kwargs["validate_cert"] = self.validate_cert
|
||||
|
||||
response = yield self.client.fetch(url, method=method, **kwargs)
|
||||
return self.adapt_response(response)
|
||||
|
||||
def adapt_response(self, response):
|
||||
if "application/json" in response.headers["Content-Type"]:
|
||||
try:
|
||||
json = loads(response.body)
|
||||
setattr(response, "json", json)
|
||||
except decoder.JSONDecodeError:
|
||||
setattr(response, "json", {})
|
||||
else:
|
||||
setattr(response, "json", {})
|
||||
setattr(response, "ok", 200 <= response.code < 300)
|
||||
return response
|
@ -61,7 +61,7 @@ def make_flask_callbacks(app):
|
||||
if re.match("\/workspaces\/[A-Za-z0-9]*", request.url)
|
||||
else "global"
|
||||
)
|
||||
g.dev = os.getenv("TORNADO_ENV", "dev") == "dev"
|
||||
g.dev = os.getenv("FLASK_ENV", "dev") == "dev"
|
||||
g.matchesPath = lambda href: re.match("^" + href, request.path)
|
||||
g.modalOpen = request.args.get("modal", False)
|
||||
g.current_user = {
|
||||
|
@ -1,5 +1,3 @@
|
||||
import tornado
|
||||
from tornado.gen import Return
|
||||
from flask_wtf import FlaskForm
|
||||
|
||||
|
||||
|
@ -1,6 +1,3 @@
|
||||
from tornado.web import UIModule
|
||||
|
||||
# from tornado.template import raw
|
||||
import re
|
||||
|
||||
|
||||
|
@ -10,7 +10,6 @@ ARG CIBUILD=true
|
||||
ENV APP_DIR "${APP_DIR}"
|
||||
ENV FLASK_ENV ci
|
||||
ENV SKIP_PIPENV true
|
||||
ENV TORNADO_ENV ci
|
||||
|
||||
# Use dumb-init for proper signal handling
|
||||
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
||||
|
@ -1,7 +1,3 @@
|
||||
import tornado.gen
|
||||
from tornado.httpclient import HTTPRequest, HTTPResponse
|
||||
|
||||
from atst.api_client import ApiClient
|
||||
from tests.factories import RequestFactory, UserFactory
|
||||
|
||||
|
||||
@ -21,44 +17,4 @@ DOD_SDN_INFO = {
|
||||
}
|
||||
DOD_SDN = f"CN={DOD_SDN_INFO['last_name']}.{DOD_SDN_INFO['first_name']}.G.{DOD_SDN_INFO['dod_id']},OU=OTHER,OU=PKI,OU=DoD,O=U.S. Government,C=US"
|
||||
|
||||
|
||||
class MockApiClient(ApiClient):
|
||||
|
||||
def __init__(self, service):
|
||||
self.service = service
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def get(self, path, **kwargs):
|
||||
return self._get_response("GET", path)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def put(self, path, **kwargs):
|
||||
return self._get_response("PUT", path)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def patch(self, path, **kwargs):
|
||||
return self._get_response("PATCH", path)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def post(self, path, **kwargs):
|
||||
return self._get_response("POST", path)
|
||||
|
||||
@tornado.gen.coroutine
|
||||
def delete(self, path, **kwargs):
|
||||
return self._get_response("DELETE", path)
|
||||
|
||||
def _get_response(self, verb, path, code=200, json=None):
|
||||
response = HTTPResponse(
|
||||
request=HTTPRequest(path, verb),
|
||||
code=code,
|
||||
headers={"Content-Type": "application/json"},
|
||||
)
|
||||
|
||||
setattr(response, "ok", 200 <= code < 300)
|
||||
if json:
|
||||
setattr(response, "json", json)
|
||||
|
||||
return response
|
||||
|
||||
|
||||
MOCK_VALID_PE_ID = "8675309U"
|
||||
|
@ -1,6 +1,5 @@
|
||||
import re
|
||||
import pytest
|
||||
import tornado
|
||||
import urllib
|
||||
from tests.mocks import MOCK_REQUEST, MOCK_USER
|
||||
from tests.factories import PENumberFactory
|
||||
|
Loading…
x
Reference in New Issue
Block a user