diff --git a/test/test_listing.py b/test/test_listing.py index 8fccdc349968ccc3b2ac6379c311b4eace9aea61..3ab9802e69aed7d519ef832dadc15130f86e9516 100644 --- a/test/test_listing.py +++ b/test/test_listing.py @@ -221,6 +221,15 @@ class TestList(unittest.TestCase): vals = [x for x in lst] assert len(vals) == 0 + @mock.patch('mwclient.client.Site') + def test_list_repr(self, mock_site): + # Test __repr__ of a List is as expected + + mock_site.__str__.return_value = "some wiki" + lst = List(mock_site, 'allpages', 'ap', limit=2, + return_values=('title', 'ns')) + assert repr(lst) == "<List object 'allpages' for some wiki>" + @mock.patch('mwclient.client.Site') def test_generator_list(self, mock_site): # Test that the GeneratorList yields Page objects