From 142050d804c76ddb756ea2a2dfabc8a16ee43b63 Mon Sep 17 00:00:00 2001 From: Matthew Scragg Date: Thu, 9 Oct 2014 16:30:34 -0500 Subject: [PATCH] updated gitignore, added wrongly ignored files --- .gitignore | 4 ++-- realms/modules/wiki/tests.py | 32 ++++++++++++++++++++++++++++++++ realms/templates/wiki/index.html | 30 ++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 realms/modules/wiki/tests.py create mode 100644 realms/templates/wiki/index.html diff --git a/.gitignore b/.gitignore index bdc2abc..5425854 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,6 @@ config.sls config.json realms/static/vendor realms/static/assets/* -wiki.db -wiki +/wiki.db +/wiki npm-debug.log diff --git a/realms/modules/wiki/tests.py b/realms/modules/wiki/tests.py new file mode 100644 index 0000000..2e5393a --- /dev/null +++ b/realms/modules/wiki/tests.py @@ -0,0 +1,32 @@ +from nose.tools import * +from flask import url_for +from realms import app, g +from realms.modules.wiki.models import Wiki, cname_to_filename, filename_to_cname +from flask.ext.testing import TestCase + + +class WikiTest(TestCase): + + def create_app(self): + app.config['TESTING'] = True + return app + + def test_wiki_routes(self): + + self.assert_200(self.client.get(url_for("wiki.create"))) + + for route in ['page', 'edit', 'history', 'index']: + rv = self.client.get(url_for("wiki.%s" % route, name='test')) + self.assert_200(rv, "wiki.%s: %s" % (route, rv.status_code)) + + def test_write_page(self): + pass + + def test_revert(self): + pass + + def test_cname_to_filename(self): + eq_(cname_to_filename('test'), 'test.md') + + def test_filename_to_cname(self): + eq_(filename_to_cname('test-1-2-3.md'), 'test-1-2-3') \ No newline at end of file diff --git a/realms/templates/wiki/index.html b/realms/templates/wiki/index.html new file mode 100644 index 0000000..304ed67 --- /dev/null +++ b/realms/templates/wiki/index.html @@ -0,0 +1,30 @@ +{% extends 'layout.html' %} + +{% block js %} + +{% endblock %} + +{% block body %} + + + + + + + + + + {% for file in index %} + + + + + + + {% endfor %} +
NameModified
{{ file['name'] }}{{ file['ctime']|datetime }}
+{% endblock %} \ No newline at end of file