def test_view_attempts_no_result(self): expected = {'limit': 20, 'offset': 0, 'filters': {'articlepkg_id': 1}, 'total': 200, 'objects': []} self.req.params = {'limit': 20, 'offset': 0, 'articlepkg_id': 1} self.req.db.query.found = False self.assertEqual( httpd.attempts(self.req), expected)
def test_view_attempts(self): expected = {'limit': 20, 'offset': 0, 'filters': {'articlepkg_id': 1}, 'total': 200, 'objects': [AttemptStub().to_dict(), AttemptStub().to_dict()]} self.req.params = {'limit': 20, 'offset': 0, 'articlepkg_id': 1} self.req.db.query.found = True self.assertEqual( httpd.attempts(self.req), expected)
def test_view_attempts_no_result(self): expected = { 'limit': 20, 'offset': 0, 'filters': { 'articlepkg_id': 1 }, 'total': 200, 'objects': [] } self.req.params = {'limit': 20, 'offset': 0, 'articlepkg_id': 1} self.req.db.query.found = False self.assertEqual(httpd.attempts(self.req), expected)
def test_view_attempts(self): expected = { 'limit': 20, 'offset': 0, 'filters': { 'articlepkg_id': 1 }, 'total': 200, 'objects': [AttemptStub().to_dict(), AttemptStub().to_dict()] } self.req.params = {'limit': 20, 'offset': 0, 'articlepkg_id': 1} self.req.db.query.found = True self.assertEqual(httpd.attempts(self.req), expected)