示例#1
0
文件: test.py 项目: jackuess/SinPy
class TestNotFound(TestCase):
    def setUp(self):
        self.nf = NotFound()
        self.nf.response = Mock()

    def test_get(self):
        r = self.nf.get()

        self.assertEqual(self.nf.response.status_code, 404)
        self.assertEqual(r, 'Not found')

    def test_post_put_delete(self):
        for method in ['post', 'put', 'delete']:
            self.assertEqual(getattr(self.nf, method),
                             self.nf.get)
示例#2
0
文件: test.py 项目: jackuess/SinPy
 def setUp(self):
     self.nf = NotFound()
     self.nf.response = Mock()