Skip to content

Commit 6b46e45

Browse files
committed
Remove unused method ReadOnlyCollection.names().
1 parent c88c6ff commit 6b46e45

File tree

2 files changed

+0
-39
lines changed

2 files changed

+0
-39
lines changed

splunklib/client.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1389,34 +1389,6 @@ def list(self, count=None, **kwargs):
13891389
# return self._load_list(response)
13901390
return list(self.iter(count=count, **kwargs))
13911391

1392-
def names(self, count=None, **kwargs):
1393-
"""Returns a list of the names of all the entities in this collection.
1394-
1395-
The entire list is loaded at once in a single roundtrip to the server,
1396-
plus at most two more if the ``autologin`` field of :func:`connect` is
1397-
set to ``True``. There is no caching--every call makes at least one round trip.
1398-
1399-
:param count: The maximum number of entities to return (optional).
1400-
:type count: ``integer``
1401-
:param kwargs: Additional arguments (optional):
1402-
1403-
- "offset" (``integer``): The offset of the first item to return.
1404-
1405-
- "search" (``string``): The search query to filter responses.
1406-
1407-
- "sort_dir" (``string``): The direction to sort returned items:
1408-
"asc" or "desc".
1409-
1410-
- "sort_key" (``string``): The field to use for sorting (optional).
1411-
1412-
- "sort_mode" (``string``): The collating sequence for sorting
1413-
returned items: "auto", "alpha", "alpha_case", or "num".
1414-
1415-
:type kwargs: ``dict``
1416-
:return: A ``list`` of entity names.
1417-
"""
1418-
return [ent.name for ent in self.iter(count=count, **kwargs)]
1419-
14201392
class Collection(ReadOnlyCollection):
14211393
"""A collection of entities.
14221394

tests/test_collection.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,6 @@ def test_list(self):
8787
msg='on %s (expected: %s, found: %s)' % \
8888
(coll_name, expected, found))
8989

90-
def test_names(self):
91-
for coll_name in collections:
92-
coll = getattr(self.service, coll_name)
93-
expected = [ent.name for ent in coll.list(count=10, sort_mode="auto")]
94-
if len(expected) == 0:
95-
logging.debug("No entities in collection %s; skipping test.", coll_name)
96-
found = coll.names(count=10, sort_mode="auto")
97-
self.assertEqual(expected, found,
98-
msg='on %s (expected: %s, found %s)' % \
99-
(coll_name, expected, found))
100-
10190
def test_list_with_count(self):
10291
N = 5
10392
for coll_name in collections:

0 commit comments

Comments
 (0)