Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
utils: Remove unused split_by function.
Anders Kaseorgf3e5ed57ae11
diff --git a/zerver/lib/utils.py b/zerver/lib/utils.pyindex dd20ae1472c..f1f0f5cfbb8 100644--- a/zerver/lib/utils.py+++ b/zerver/lib/utils.py@@ -1,7 +1,6 @@import hashlibimport reimport secrets-from itertools import zip_longestfrom typing import Any, Callable, List, Optional, TypeVarfrom django.conf import settings@@ -108,12 +107,3 @@ def process_list_in_batches(breakprocess_batch(items)offset += chunk_size---def split_by(array: List[Any], group_size: int, filler: Any) -> List[List[Any]]:- """- Group elements into list of size `group_size` and fill empty cells with- `filler`. Recipe from https://docs.python.org/3/library/itertools.html- """- args = [iter(array)] * group_size- return list(map(list, zip_longest(*args, fillvalue=filler)))diff --git a/zerver/tests/test_docs.py b/zerver/tests/test_docs.pyindex c728eed2233..280383d3cb5 100644--- a/zerver/tests/test_docs.py+++ b/zerver/tests/test_docs.py@@ -15,7 +15,6 @@ from zerver.context_processors import get_apps_page_urlfrom zerver.lib.integrations import INTEGRATIONSfrom zerver.lib.test_classes import ZulipTestCasefrom zerver.lib.test_helpers import HostRequestMock-from zerver.lib.utils import split_byfrom zerver.models import Realm, get_realmfrom zerver.views.documentation import add_api_uri_context@@ -374,12 +373,6 @@ class AboutPageTest(ZulipTestCase):self.assertEqual(result.status_code, 301)self.assertEqual(result["Location"], "https://zulip.com/team/")- def test_split_by(self) -> None:- """Utility function primarily used in authors page"""- flat_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]- expected_result = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]- self.assertEqual(split_by(flat_list, 3, None), expected_result)-class SmtpConfigErrorTest(ZulipTestCase):def test_smtp_error(self) -> None: