jenkins-bot merged this change.
[tests] test ranges of maximum items
There are two tests that PageGenerator yields the requested
amount of pages which can combined and expanded. The new
method also tests not to get more items if query stops.
Change-Id: I78b2354f4f00af59bacc8e0c4646e722bea9b50b
---
M tests/api_tests.py
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/tests/api_tests.py b/tests/api_tests.py
index 9cd52b3..f08dbe8 100644
--- a/tests/api_tests.py
+++ b/tests/api_tests.py
@@ -653,15 +653,12 @@
r"invalid literal for int\(\) with base 10: 'test'"):
self.gen.set_maximum_items('test')
- def test_limit_equal_total(self):
+ def test_limit_range(self):
"""Test that PageGenerator yields the requested amount of pages."""
- self.gen.set_maximum_items(4)
- self.assertPageTitlesEqual(self.gen, self.titles)
-
- def test_limit_one(self):
- """Test that PageGenerator yields the requested amount of pages."""
- self.gen.set_maximum_items(1)
- self.assertPageTitlesEqual(self.gen, self.titles[0:1])
+ for i in range(1, 6):
+ with self.subTest(amount=i):
+ self.gen.set_maximum_items(i)
+ self.assertPageTitlesEqual(self.gen, self.titles[:i])
def test_limit_zero(self):
"""Test that a limit of zero is the same as limit None."""
To view, visit change 513726. To unsubscribe, or for help writing mail filters, visit settings.