Skip to content

Commit e630c4e

Browse files
author
Frederick Ross
committed
Moved service in testlib back onto instance and off of class; left opts on class.
1 parent 5af3ae7 commit e630c4e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/test_app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ def setUp(self):
4141

4242
@classmethod
4343
def tearDownClass(cls):
44-
for app in cls.service.apps:
44+
import splunklib.client as client
45+
service = client.connect(**cls.opts.kwargs)
46+
for app in service.apps:
4547
if app.name.startswith('delete-me'):
46-
cls.service.apps.delete(app.name)
48+
service.apps.delete(app.name)
4749

4850
def test_app_integrity(self):
4951
self.check_entity(self.app)

tests/testlib.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,10 @@ def f(_):
164164
@classmethod
165165
def setUpClass(cls):
166166
cls.opts = parse([], {}, ".splunkrc")
167-
import splunklib.client as client
168-
cls.service = client.connect(**cls.opts.kwargs)
169167

170168
def setUp(self):
171169
unittest.TestCase.setUp(self)
172170
import splunklib.client as client
173-
self.opts = parse([], {}, ".splunkrc")
174171
self.service = client.connect(**self.opts.kwargs)
175172
self.splunk_version = int(self.service.info['version'].split('.')[0])
176173
logging.debug("Connected to splunkd version %s", '.'.join(str(x) for x in self.service.splunk_version))

0 commit comments

Comments
 (0)