Browse files

Blueprint example tests

  • Loading branch information...
1 parent 85ad4ff commit 62621ccd133ffcbe2c88d18841c0669d03739ac0 @dmishe dmishe committed Mar 1, 2012
Showing with 36 additions and 0 deletions.
  1. +36 −0 examples/blueprintexample/blueprintexample_test.py
View
36 examples/blueprintexample/blueprintexample_test.py
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+"""
+ Blueprint Example Tests
+ ~~~~~~~~~~~~~~
+
+ Tests the Blueprint example app
+"""
+import blueprintexample
+import unittest
+
+
+class BlueprintExampleTestCase(unittest.TestCase):
+
+ def setUp(self):
+ self.app = blueprintexample.app.test_client()
+
+ def test_urls(self):
+ r = self.app.get('/')
+ self.assertEquals(r.status_code, 200)
+
+ r = self.app.get('/hello')
+ self.assertEquals(r.status_code, 200)
+
+ r = self.app.get('/world')
+ self.assertEquals(r.status_code, 200)
+
+ #second blueprint instance
+ r = self.app.get('/pages/hello')
+ self.assertEquals(r.status_code, 200)
+
+ r = self.app.get('/pages/world')
+ self.assertEquals(r.status_code, 200)
+
+
+if __name__ == '__main__':
+ unittest.main()

0 comments on commit 62621cc

Please sign in to comment.