예제 #1
0
 def test_page_with_page(self, m_fetch):
     """Test providing page with a page and a size."""
     q = Query('Environment')
     q.page(page=3, pagesize=500)
     expected = "SKIP 1000"
     self.assertTrue(expected in str(q))
     expected = "LIMIT 500"
     self.assertTrue(expected in str(q))
예제 #2
0
 def test_page_with_negative_index(self, m_fetch):
     """Test providing page with a negative index and a size."""
     q = Query('Environment')
     q.page(index=-10, pagesize=500)
     expected = "SKIP 0"
     self.assertTrue(expected in str(q))
     expected = "LIMIT 500"
     self.assertTrue(expected in str(q))
예제 #3
0
    def test_page_defaults(self, m_fetch):
        """Test default arguments to page() method."""
        q = Query('Environment')
        q.page()

        expected = 'SKIP 0'
        self.assertTrue(expected in str(q))
        expected = 'LIMIT 100'
        self.assertTrue(expected in str(q))