aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-10-29 12:42:29 +0100
committerElena ``of Valhalla'' Grandi <valhalla@trueelena.org>2017-10-29 12:42:29 +0100
commita5fbd781ccc9b64483cc499c375fa6e0e99ade1d (patch)
tree3bab3d0d6682fae6ba0a350db2326538b70988df
Project skeleton
-rw-r--r--.gitignore4
-rw-r--r--cherry_lesana/__init__.py1
-rw-r--r--cherry_lesana/app.py13
-rwxr-xr-xclesana16
-rwxr-xr-xrun_tests5
-rw-r--r--tests/test_views.py15
6 files changed, 54 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..da71240
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+__pycache__
+*.pyc
+.cache
+.*.sw?
diff --git a/cherry_lesana/__init__.py b/cherry_lesana/__init__.py
new file mode 100644
index 0000000..d0f067c
--- /dev/null
+++ b/cherry_lesana/__init__.py
@@ -0,0 +1 @@
+from .app import App
diff --git a/cherry_lesana/app.py b/cherry_lesana/app.py
new file mode 100644
index 0000000..4ab7672
--- /dev/null
+++ b/cherry_lesana/app.py
@@ -0,0 +1,13 @@
+
+import cherrypy
+
+
+class App:
+ """
+ """
+
+ @cherrypy.expose
+ def index(self):
+ cherrypy.log('asd')
+ return "Hello World"
+
diff --git a/clesana b/clesana
new file mode 100755
index 0000000..492c74c
--- /dev/null
+++ b/clesana
@@ -0,0 +1,16 @@
+#!/usr/bin/env python3
+
+import cherrypy
+
+import cherry_lesana as cl
+
+def main():
+ # TODO: read config from a file or something
+ config = {
+ '/': {
+ },
+ }
+ cherrypy.quickstart(cl.App(), '/', config)
+
+if __name__ == '__main__':
+ main()
diff --git a/run_tests b/run_tests
new file mode 100755
index 0000000..ad9eb3d
--- /dev/null
+++ b/run_tests
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+python3 -m pytest -s
+pyflakes3 .
+pycodestyle .
diff --git a/tests/test_views.py b/tests/test_views.py
new file mode 100644
index 0000000..9c0c471
--- /dev/null
+++ b/tests/test_views.py
@@ -0,0 +1,15 @@
+import cherrypy
+
+from cherrypy.test import helper
+
+from cherry_lesana import App
+
+
+class TestViews(helper.CPWebCase):
+ def setup_server():
+ cherrypy.tree.mount(App())
+ setup_server = staticmethod(setup_server)
+
+ def test_root(self):
+ self.getPage('/')
+ self.assertStatus(200)