Skip to content

Commit a5b921f

Browse files
author
Sam Stelle
committed
Added test for new context.connect() function
1 parent 85a56b0 commit a5b921f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/test_binding.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import logging
2424
import testlib
2525
import unittest
26+
import socket
2627

2728
import splunklib.binding as binding
2829
from splunklib.binding import HTTPError, AuthenticationError, UrlEncoded
@@ -288,6 +289,12 @@ def test_unicode_socket(self):
288289
socket.write("\r\n")
289290
socket.close()
290291

292+
def test_socket_gethostbyname(self):
293+
self.assertTrue(self.context.connect())
294+
self.context.host = socket.gethostbyname(self.context.host)
295+
self.assertTrue(self.context.connect())
296+
297+
291298
class TestUnicodeConnect(BindingTestCase):
292299
def test_unicode_connect(self):
293300
opts = self.opts.kwargs.copy()

0 commit comments

Comments
 (0)