Esempio n. 1
0
 def test_thread_last_page(self):
     """Thread's last_page property is accurate."""
     t = ThreadFactory()
     # Format: (# replies, # of pages to expect)
     test_data = ((t.replies, 1),  # Test default
                  (50, 3),  # Test a large number
                  (19, 1),  # Test off-by-one error, low
                  (20, 2))  # Test off-by-one error, high
     for replies, pages in test_data:
         t.replies = replies
         eq_(t.last_page, pages)
Esempio n. 2
0
 def test_thread_last_page(self):
     """Thread's last_page property is accurate."""
     t = ThreadFactory()
     # Format: (# replies, # of pages to expect)
     test_data = (
         (t.replies, 1),  # Test default
         (50, 3),  # Test a large number
         (19, 1),  # Test off-by-one error, low
         (20, 2))  # Test off-by-one error, high
     for replies, pages in test_data:
         t.replies = replies
         eq_(t.last_page, pages)