Skip to content

Commit 059202f

Browse files
author
Frederick Ross
committed
Rework test_saved_search.py
Lots and lots of errors from it that need to be fixed and weren't being caught before. Found a bunch of other tests to do as well, added to todos (except once which I went ahead and did in test_input.py)
1 parent d907b6c commit 059202f

3 files changed

Lines changed: 143 additions & 318 deletions

File tree

‎splunklib/client.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ class JobNotReadyException(Exception):
119119
class AmbiguousReferenceException(ValueError):
120120
pass
121121

122+
class EntityDeletedException(Exception):
123+
pass
124+
122125
def trailing(template, *targets):
123126
"""Substring of *template* following all *targets*.
124127

‎tests/test_input.py‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,15 @@ def test_delete(self):
9696
inputs = self.service.inputs
9797
for test_input in test_inputs:
9898
kind, name = test_input['kind'], test_input['name']
99+
input_entity = self.service.inputs[kind,name]
99100
self.assertTrue(name in inputs)
100101
self.assertTrue((kind,name) in inputs)
101102
self.service.inputs.delete(kind['name'])
102103
self.assertFalse(name in inputs)
103104
self.assertFalse((kind,name) in inputs)
105+
self.assertRaises(client.EntityDeletedException,
106+
input_entity.refresh)
107+
104108

105109
if __name__ == "__main__":
106110
testlib.main()

0 commit comments

Comments
 (0)