Skip to content

Commit b8ca8ac

Browse files
committed
Process rogue FIXME from CHANGELOG. Tested too.
1 parent ec0f29c commit b8ca8ac

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
splunkd has restarted or the timeout has passed; if it is not specified, then it returns
1616
immediately and you have to check whether splunkd has restarted yourself.
1717
* `Collections.__getitem__` can fetch items from collections
18-
with an explicit namespace. For example, instead of
19-
`'Top five sourcetypes' in service.saved_searches`, you can also write
20-
`('Top five sourcetypes', record({'owner': 'nobody', 'app': 'search'})) in service.saved_searches`.
21-
[FIXME: This looks ridiculous. Has it been tested?
22-
Given a lack of record() calls in the tests, I doubt it.]
18+
with an explicit namespace. For example, in addition to
19+
`result = service.saved_searches['Top five sourcetypes']`, you can write:
20+
21+
```
22+
from splunklib.binding import namespace
23+
ns = client.namespace(owner='nobody', app='search')
24+
result = service.saved_searches['Top five sourcetypes', ns]
25+
```
26+
2327
* Extended `SavedSearch`:
2428
- New properties: `alert_count`, `fired_alerts`, `scheduled_times`, `suppressed`
2529
- New operations: `suppress`, `unsuppress`

tests/test_collection.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ def test_getitem_with_nonsense(self):
238238
name = testlib.tmpname()
239239
self.assertTrue(name not in coll)
240240
self.assertRaises(KeyError, coll.__getitem__, name)
241+
242+
def test_getitem_with_namespace_sample_in_changelog(self):
243+
from splunklib.binding import namespace
244+
ns = client.namespace(owner='nobody', app='search')
245+
result = self.service.saved_searches['Top five sourcetypes', ns]
241246

242247
if __name__ == "__main__":
243248
try:

0 commit comments

Comments
 (0)