From 133bc6fa86c3972070b9a73f65ca1dce107b8717 Mon Sep 17 00:00:00 2001 From: Brian Duggan Date: Thu, 31 May 2018 10:25:23 -0400 Subject: [PATCH 1/4] Add test_routes, which tests routes --- tests/test_routes.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/test_routes.py diff --git a/tests/test_routes.py b/tests/test_routes.py new file mode 100644 index 00000000..c6f265b0 --- /dev/null +++ b/tests/test_routes.py @@ -0,0 +1,23 @@ +import pytest +import tornado.web +from atst.app import make_app + +@pytest.fixture +def app(): + return make_app() + +@pytest.mark.gen_test +def test_routes(http_client, base_url): + for path in ( + '/', + '/home', + '/workspaces', + '/requests', + '/requests/new', + '/requests/new/1', + '/users', + '/reports', + '/calculator' + ): + response = yield http_client.fetch(base_url + path) + assert response.code == 200 From 1b825e77096c603e58de961091b2454a4f7aabe3 Mon Sep 17 00:00:00 2001 From: Brian Duggan Date: Thu, 31 May 2018 10:17:55 -0400 Subject: [PATCH 2/4] Fix formatting of routes table --- atst/app.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/atst/app.py b/atst/app.py index 519ac1a2..2cba648c 100644 --- a/atst/app.py +++ b/atst/app.py @@ -7,12 +7,12 @@ from tornado.web import url def make_app(**kwargs): app = tornado.web.Application([ - url( r"/", MainHandler, {'page': 'login'}, name='login' ), + url( r"/", MainHandler, {'page': 'login'}, name='login' ), url( r"/home", MainHandler, {'page': 'home'}, name='home' ), - url( r"/workspaces", MainHandler, {'page': 'workspaces'}, name='workspaces' ), + url( r"/workspaces", MainHandler, {'page': 'workspaces'}, name='workspaces' ), url( r"/requests", Request, {'page': 'requests'}, name='requests' ), - url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ), - url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ), + url( r"/requests/new", RequestNew, {'page': 'requests_new'}, name='request_new' ), + url( r"/requests/new/([0-9])", RequestNew, {'page': 'requests_new'}, name='request_form' ), url( r"/users", MainHandler, {'page': 'users'}, name='users' ), url( r"/reports", MainHandler, {'page': 'reports'}, name='reports' ), url( r"/calculator", MainHandler, {'page': 'calculator'}, name='calculator' ), From e004360e1685e13c219fc023ad02b77ce2713d9e Mon Sep 17 00:00:00 2001 From: Luis Cielak Date: Thu, 31 May 2018 10:20:03 -0400 Subject: [PATCH 3/4] Rename workplaces.html to workspaces.html --- templates/workspaces.html.to | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 templates/workspaces.html.to diff --git a/templates/workspaces.html.to b/templates/workspaces.html.to new file mode 100644 index 00000000..c6f4dbd0 --- /dev/null +++ b/templates/workspaces.html.to @@ -0,0 +1,34 @@ +{% extends "base.html.to" %} + +{% block content %} + +
+ +

Workspaces

+ + + + + + + + + + + + + + + + +
Workplace NameWorkplace InfoActions
+ Unclassified IaaS and PaaS for Defense Digital Service (DDS)
+ Task Order: #123456 +
+ 23
Users +
+ +
+ +{% end %} + From bf367c595002e3d29ac8f6c858abd970a4d286af Mon Sep 17 00:00:00 2001 From: Brian Duggan Date: Thu, 31 May 2018 10:25:07 -0400 Subject: [PATCH 4/4] Remove Makefile, update README --- Makefile | 5 ----- README.md | 10 +++------- 2 files changed, 3 insertions(+), 12 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index e4fb2f72..00000000 --- a/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -test: - python -m pytest - -clean: - find static/assets -type f |grep -v .gitignore | xargs rm diff --git a/README.md b/README.md index 4d3d6933..b8d5baed 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ## Installation - ./script/setup + script/setup The setup script will create a new Python virtual environment for the application to use. All of the scripts will activate this virutal envirnment automatically, but you can also manually activate it like this: @@ -21,22 +21,18 @@ If you want to automatically load the virtual environment whenever you enter the To start the app and watch for changes: - DEBUG=1 ./script/server + DEBUG=1 script/server ## Testing To run unit tests: - ./script/test + script/test or python -m pytest -or - - make test - ## Notes tornado templates are like mustache templates -- add the