Exemplo n.º 1
0
    def test_view_package_no_result(self):
        self.req.db.query.found = False
        self.req.matchdict = {'id': 1}

        self.assertIsInstance(
            httpd.attempt(self.req),
            HTTPNotFound
        )
Exemplo n.º 2
0
    def test_view_attempt(self):
        expected = AttemptStub().to_dict()

        self.req.db.query.found = True
        self.req.matchdict = {'id': 1}
        self.assertEqual(
            httpd.attempt(self.req),
            expected)
Exemplo n.º 3
0
    def test_view_package_no_result(self):
        self.req.db.query.found = False
        self.req.matchdict = {'id': 1}

        self.assertIsInstance(httpd.attempt(self.req), HTTPNotFound)
Exemplo n.º 4
0
    def test_view_attempt(self):
        expected = AttemptStub().to_dict()

        self.req.db.query.found = True
        self.req.matchdict = {'id': 1}
        self.assertEqual(httpd.attempt(self.req), expected)