def METHOD_NAME(self):
    def paging(query):
        if query == _EXP_QUERY_FIRST_PAGE:
            return self.mock_result(
                ["foo", "bar"], total_count=3, has_next_page=True
            )
        elif query == _EXP_QUERY_SECOND_PAGE:
            return self.mock_result(["baz"], total_count="unused")
        else:
            raise ValueError("Bad query: %s" % query)
    self.client.execute = mock.MagicMock(side_effect=paging)
    self.assertEqual(
        list(
            self.client.execute_and_paginate(_TEST_QUERY, _TEST_QUERY_PATH)
        ),
        ["foo", "bar", "baz"],
    )
    self.assertEqual(self.client.execute.call_count, 2)