Skip to content

Commit 80fe325

Browse files
committed
Set autologin=True while running tests.
When autologin is set to False, the client does not attempt to re-authenticate on a 401 response and instead fails with an AuthenticationError.
1 parent 1aa5b20 commit 80fe325

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/test_service.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626

2727
class ServiceTestCase(testlib.SDKTestCase):
2828
def test_autologin(self):
29-
service = client.connect(autologin=True, **self.opts.kwargs)
29+
self.assertTrue(self.opts.kwargs.get("autologin"))
30+
service = client.connect(**self.opts.kwargs)
3031
self.service.restart(timeout=120)
3132
reader = service.jobs.oneshot("search index=internal | head 1")
3233
self.assertIsNotNone(reader)

tests/testlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def restartSplunk(self, timeout=240):
233233
@classmethod
234234
def setUpClass(cls):
235235
cls.opts = parse([], {}, ".env")
236-
cls.opts.kwargs.update({"retries": 3})
236+
cls.opts.kwargs.update({"retries": 3, "autologin": True})
237237
# Before we start, make sure splunk doesn't need a restart.
238238
service = client.connect(**cls.opts.kwargs)
239239
if service.restart_required:

0 commit comments

Comments
 (0)