summaryrefslogtreecommitdiff
path: root/docs/quick_tour
diff options
context:
space:
mode:
authorSteve Piercy <web@stevepiercy.com>2019-12-27 02:47:04 -0800
committerSteve Piercy <web@stevepiercy.com>2020-01-02 23:30:59 -0800
commitf61a292939d2a41598f45fc8f908343eb8859e23 (patch)
treee5283c6b40671d246d3c57da1750b41c6ca9f4ef /docs/quick_tour
parentc86c61bfbab809d55b8d1a53e4a2b47505317720 (diff)
downloadpyramid-f61a292939d2a41598f45fc8f908343eb8859e23.tar.gz
pyramid-f61a292939d2a41598f45fc8f908343eb8859e23.tar.bz2
pyramid-f61a292939d2a41598f45fc8f908343eb8859e23.zip
Update tests.py with 100% coverage
Diffstat (limited to 'docs/quick_tour')
-rw-r--r--docs/quick_tour/logging/hello_world/tests.py10
-rw-r--r--docs/quick_tour/package/hello_world/tests.py10
-rw-r--r--docs/quick_tour/sessions/hello_world/tests.py10
3 files changed, 30 insertions, 0 deletions
diff --git a/docs/quick_tour/logging/hello_world/tests.py b/docs/quick_tour/logging/hello_world/tests.py
index f01ae2a3c..b747e7679 100644
--- a/docs/quick_tour/logging/hello_world/tests.py
+++ b/docs/quick_tour/logging/hello_world/tests.py
@@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase):
info = my_view(request)
self.assertEqual(info['project'], 'hello_world')
+ def test_notfound_view(self):
+ from .views.notfound import notfound_view
+ request = testing.DummyRequest()
+ info = notfound_view(request)
+ self.assertEqual(info, {})
+
class FunctionalTests(unittest.TestCase):
def setUp(self):
@@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase):
def test_root(self):
res = self.testapp.get('/', status=200)
self.assertTrue(b'Pyramid' in res.body)
+
+ def test_notfound(self):
+ res = self.testapp.get('/badurl', status=404)
+ self.assertTrue(res.status_code == 404)
diff --git a/docs/quick_tour/package/hello_world/tests.py b/docs/quick_tour/package/hello_world/tests.py
index f01ae2a3c..b747e7679 100644
--- a/docs/quick_tour/package/hello_world/tests.py
+++ b/docs/quick_tour/package/hello_world/tests.py
@@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase):
info = my_view(request)
self.assertEqual(info['project'], 'hello_world')
+ def test_notfound_view(self):
+ from .views.notfound import notfound_view
+ request = testing.DummyRequest()
+ info = notfound_view(request)
+ self.assertEqual(info, {})
+
class FunctionalTests(unittest.TestCase):
def setUp(self):
@@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase):
def test_root(self):
res = self.testapp.get('/', status=200)
self.assertTrue(b'Pyramid' in res.body)
+
+ def test_notfound(self):
+ res = self.testapp.get('/badurl', status=404)
+ self.assertTrue(res.status_code == 404)
diff --git a/docs/quick_tour/sessions/hello_world/tests.py b/docs/quick_tour/sessions/hello_world/tests.py
index f01ae2a3c..b747e7679 100644
--- a/docs/quick_tour/sessions/hello_world/tests.py
+++ b/docs/quick_tour/sessions/hello_world/tests.py
@@ -16,6 +16,12 @@ class ViewTests(unittest.TestCase):
info = my_view(request)
self.assertEqual(info['project'], 'hello_world')
+ def test_notfound_view(self):
+ from .views.notfound import notfound_view
+ request = testing.DummyRequest()
+ info = notfound_view(request)
+ self.assertEqual(info, {})
+
class FunctionalTests(unittest.TestCase):
def setUp(self):
@@ -27,3 +33,7 @@ class FunctionalTests(unittest.TestCase):
def test_root(self):
res = self.testapp.get('/', status=200)
self.assertTrue(b'Pyramid' in res.body)
+
+ def test_notfound(self):
+ res = self.testapp.get('/badurl', status=404)
+ self.assertTrue(res.status_code == 404)