Skip to content
Myr

blueprintexample_test.py

This file

Path

examples/blueprintexample/blueprintexample_test.py

36 lines · 867 bytes · Python

Last changed by

Not known.

History of this file

Take it

1# -*- coding: utf-8 -*-2"""3    Blueprint Example Tests4    ~~~~~~~~~~~~~~56    Tests the Blueprint example app7"""8import blueprintexample9import unittest101112class BlueprintExampleTestCase(unittest.TestCase):1314    def setUp(self):15        self.app = blueprintexample.app.test_client()16        17    def test_urls(self):18        r = self.app.get('/')19        self.assertEquals(r.status_code, 200)20        21        r = self.app.get('/hello')22        self.assertEquals(r.status_code, 200)23        24        r = self.app.get('/world')25        self.assertEquals(r.status_code, 200)26        27        #second blueprint instance28        r = self.app.get('/pages/hello')29        self.assertEquals(r.status_code, 200)30        31        r = self.app.get('/pages/world')32        self.assertEquals(r.status_code, 200)33        34        35if __name__ == '__main__':36    unittest.main()