Commit b0fb6ef9 authored by katsel's avatar katsel
Browse files

Test if date matches

parent ce719e9c
from nose.tools import *
import flask
from datetime import datetime,date
from resttime import *
app.config['TESTING'] = True
......@@ -16,3 +17,10 @@ def test_index():
assert_equal(resp.status_code, expected), "Expected status %r is not %r" % (
expected, resp.status_code)
assert resp.data, "Response data is empty."
def test_date():
# check that the date is correct
with web.get('/time') as resp:
restline = resp.data.splitlines()[0].decode('utf-8')
resttime = datetime.strptime(restline, '%a %b %d %H:%M:%S %Y')
assert resttime.date() == date.today(), "Date does not match"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment