예제 #1
0
    def test_get_page_start_negative(self):
        """Test that calling the get_page_start returns 0 when called with a\
            number <= 1"""
        expected_result = 0
        expected_result2 = 0
        query = XSEQueries('test', 'test')
        actual_result = query.get_page_start(-4, 10)
        actual_result2 = query.get_page_start(1, 33)

        self.assertEqual(expected_result, actual_result)
        self.assertEqual(expected_result2, actual_result2)
예제 #2
0
    def test_get_page_start_positive(self):
        """Test that calling the get_page_start returns the correct index when\
            called with correct values"""
        expected_result = 40
        expected_result2 = 1
        query = XSEQueries('test', 'test')
        actual_result = query.get_page_start(6, 8)
        actual_result2 = query.get_page_start(2, 1)

        self.assertEqual(expected_result, actual_result)
        self.assertEqual(expected_result2, actual_result2)