summaryrefslogtreecommitdiffhomepage
path: root/test/test_python_application.py
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2018-02-12 16:58:40 +0300
committerValentin Bartenev <vbart@nginx.com>2018-02-12 16:58:40 +0300
commit9646772a00e50c437e0b3204ce6233b6414e1053 (patch)
tree07d32260bd2b109883f865fdefb350f09023740a /test/test_python_application.py
parentdc50773e518f6e68109384cb37c91985dbc3fe63 (diff)
downloadunit-9646772a00e50c437e0b3204ce6233b6414e1053.tar.gz
unit-9646772a00e50c437e0b3204ce6233b6414e1053.tar.bz2
HTTP: the Date response header.
Diffstat (limited to '')
-rw-r--r--test/test_python_application.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/test_python_application.py b/test/test_python_application.py
index e5f1d02c..5f9debb8 100644
--- a/test/test_python_application.py
+++ b/test/test_python_application.py
@@ -1,3 +1,4 @@
+import time
import unittest
import unit
@@ -62,6 +63,9 @@ def application(environ, start_response):
headers = resp['headers']
self.assertRegex(headers.pop('Server'), r'unit/[\d\.]+',
'server header')
+ self.assertLess(abs(time.mktime(time.gmtime()) -
+ time.mktime(time.strptime(headers.pop('Date'),
+ '%a, %d %b %Y %H:%M:%S GMT'))), 5, 'date header')
self.assertDictEqual(headers, {
'Content-Length': str(len(body)),
'Content-Type': 'text/html',