Skip to content

Commit 893b0d7

Browse files
committed
changes
1 parent 5340cfc commit 893b0d7

11 files changed

+44
-55
lines changed

tests/test_collection.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
from contextlib import contextmanager
2121

2222
from splunklib import client
23-
from splunklib.six.moves import range
2423

2524
collections = [
2625
'apps',

tests/test_conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from tests import testlib
1818

1919
from splunklib import client
20-
from splunklib import six
2120

2221
class TestRead(testlib.SDKTestCase):
2322
def test_read(self):
@@ -88,7 +87,7 @@ def test_confs(self):
8887
testlib.tmpname(): testlib.tmpname()}
8988
stanza.submit(values)
9089
stanza.refresh()
91-
for key, value in six.iteritems(values):
90+
for key, value in values.items():
9291
self.assertTrue(key in stanza)
9392
self.assertEqual(value, stanza[key])
9493

tests/test_input.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from splunklib.binding import HTTPError
1919

2020
from tests import testlib
21-
from splunklib import six, client
21+
from splunklib import client
2222

2323

2424

@@ -200,7 +200,7 @@ def setUp(self):
200200

201201
def tearDown(self):
202202
super().tearDown()
203-
for entity in six.itervalues(self._test_entities):
203+
for entity in self._test_entities.values():
204204
try:
205205
self.service.inputs.delete(
206206
kind=entity.kind,
@@ -231,7 +231,7 @@ def test_lists_modular_inputs(self):
231231

232232
def test_create(self):
233233
inputs = self.service.inputs
234-
for entity in six.itervalues(self._test_entities):
234+
for entity in self._test_entities.values():
235235
self.check_entity(entity)
236236
self.assertTrue(isinstance(entity, client.Input))
237237

@@ -242,7 +242,7 @@ def test_get_kind_list(self):
242242

243243
def test_read(self):
244244
inputs = self.service.inputs
245-
for this_entity in six.itervalues(self._test_entities):
245+
for this_entity in self._test_entities.values():
246246
kind, name = this_entity.kind, this_entity.name
247247
read_entity = inputs[name, kind]
248248
self.assertEqual(this_entity.kind, read_entity.kind)
@@ -258,7 +258,7 @@ def test_read_indiviually(self):
258258

259259
def test_update(self):
260260
inputs = self.service.inputs
261-
for entity in six.itervalues(self._test_entities):
261+
for entity in self._test_entities.values():
262262
kind, name = entity.kind, entity.name
263263
kwargs = {'host': 'foo'}
264264
entity.update(**kwargs)
@@ -269,7 +269,7 @@ def test_update(self):
269269
def test_delete(self):
270270
inputs = self.service.inputs
271271
remaining = len(self._test_entities)-1
272-
for input_entity in six.itervalues(self._test_entities):
272+
for input_entity in self._test_entities.values():
273273
name = input_entity.name
274274
kind = input_entity.kind
275275
self.assertTrue(name in inputs)

tests/test_kvstore_batch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# under the License.
1616

1717
from tests import testlib
18-
from splunklib.six.moves import range
1918

2019
from splunklib import client
2120

@@ -26,7 +25,7 @@ def setUp(self):
2625
# self.service.namespace['owner'] = 'nobody'
2726
self.service.namespace['app'] = 'search'
2827
confs = self.service.kvstore
29-
if ('test' in confs):
28+
if 'test' in confs:
3029
confs['test'].delete()
3130
confs.create('test')
3231

tests/test_kvstore_data.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import json
1818
from tests import testlib
19-
from splunklib.six.moves import range
2019

2120
from splunklib import client
2221

tests/test_results.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from io import BytesIO
1818

19-
from splunklib.six import StringIO
2019
from tests import testlib
2120
from time import sleep
2221
from splunklib import results

tests/test_saved_search.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
from time import sleep
2222

2323
from splunklib import client
24-
from splunklib.six.moves import zip
2524

2625
import pytest
2726

tests/test_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
# License for the specific language governing permissions and limitations
1515
# under the License.
1616

17-
from tests import testlib
1817
import unittest
18+
from tests import testlib
1919

2020
from splunklib import client
2121
from splunklib.binding import AuthenticationError
@@ -56,7 +56,7 @@ def test_info_with_namespace(self):
5656
try:
5757
self.assertEqual(self.service.info.licenseState, 'OK')
5858
except HTTPError as he:
59-
self.fail("Couldn't get the server info, probably got a 403! %s" % he.message)
59+
self.fail(f"Couldn't get the server info, probably got a 403! {he.message}")
6060

6161
self.service.namespace["owner"] = owner
6262
self.service.namespace["app"] = app
@@ -186,7 +186,7 @@ def setUp(self):
186186

187187
def assertIsNotNone(self, obj, msg=None):
188188
if obj is None:
189-
raise self.failureException(msg or '%r is not None' % obj)
189+
raise self.failureException(msg or f'{obj} is not None')
190190

191191
def test_login_and_store_cookie(self):
192192
self.assertIsNotNone(self.service.get_cookies())
@@ -363,5 +363,5 @@ def test_proper_namespace_with_service_namespace(self):
363363

364364

365365
if __name__ == "__main__":
366-
import unittest
366+
367367
unittest.main()

tests/test_storage_passwords.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# under the License.
1616

1717
from tests import testlib
18-
import logging
1918

2019
from splunklib import client
2120

tests/test_user.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# under the License.
1616

1717
from tests import testlib
18-
import logging
1918

2019
from splunklib import client
2120

0 commit comments

Comments
 (0)