Skip to content

Commit af68262

Browse files
committed
Update test_utils.py
1 parent 968f01e commit af68262

File tree

1 file changed

+32
-30
lines changed

1 file changed

+32
-30
lines changed

tests/test_utils.py

Lines changed: 32 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
raise Exception("Add the SDK repository to your PYTHONPATH to run the test cases "
1111
"(e.g., export PYTHONPATH=~/splunk-sdk-python.")
1212

13-
1413
TEST_DICT = {
15-
'username':'admin',
16-
'password':'changeme',
17-
'port' : 8089,
18-
'host' : 'localhost',
19-
'scheme': 'https'
20-
}
14+
'username': 'admin',
15+
'password': 'changeme',
16+
'port': 8089,
17+
'host': 'localhost',
18+
'scheme': 'https'
19+
}
20+
2121

2222
class TestUtils(testlib.SDKTestCase):
2323
def setUp(self):
@@ -26,16 +26,16 @@ def setUp(self):
2626
# Test dslice when a dict is passed to change key names
2727
def test_dslice_dict_args(self):
2828
args = {
29-
'username':'user-name',
30-
'password':'new_password',
31-
'port': 'admin_port',
32-
'foo':'bar'
33-
}
29+
'username': 'user-name',
30+
'password': 'new_password',
31+
'port': 'admin_port',
32+
'foo': 'bar'
33+
}
3434
expected = {
35-
'user-name':'admin',
36-
'new_password':'changeme',
37-
'admin_port':8089
38-
}
35+
'user-name': 'admin',
36+
'new_password': 'changeme',
37+
'admin_port': 8089
38+
}
3939
self.assertTrue(expected == dslice(TEST_DICT, args))
4040

4141
# Test dslice when a list is passed
@@ -46,44 +46,46 @@ def test_dslice_list_args(self):
4646
'port',
4747
'host',
4848
'foo'
49-
]
49+
]
5050
expected = {
51-
'username':'admin',
52-
'password':'changeme',
53-
'port':8089,
54-
'host':'localhost'
55-
}
51+
'username': 'admin',
52+
'password': 'changeme',
53+
'port': 8089,
54+
'host': 'localhost'
55+
}
5656
self.assertTrue(expected == dslice(TEST_DICT, test_list))
5757

5858
# Test dslice when a single string is passed
5959
def test_dslice_arg(self):
6060
test_arg = 'username'
6161
expected = {
62-
'username':'admin'
63-
}
62+
'username': 'admin'
63+
}
6464
self.assertTrue(expected == dslice(TEST_DICT, test_arg))
6565

6666
# Test dslice using all three types of arguments
6767
def test_dslice_all_args(self):
6868
test_args = [
69-
{'username':'new_username'},
69+
{'username': 'new_username'},
7070
['password',
71-
'host'],
71+
'host'],
7272
'port'
7373
]
7474
expected = {
75-
'new_username':'admin',
76-
'password':'changeme',
77-
'host':'localhost',
78-
'port':8089
75+
'new_username': 'admin',
76+
'password': 'changeme',
77+
'host': 'localhost',
78+
'port': 8089
7979
}
8080
self.assertTrue(expected == dslice(TEST_DICT, *test_args))
8181

82+
8283
class FilePermissionTest(unittest.TestCase):
8384

8485
def setUp(self):
8586
super(FilePermissionTest, self).setUp()
8687

88+
# Check for any change in the default file permission(i.e 644) for all files within splunklib
8789
def test_filePermissions(self):
8890

8991
def checkFilePermissions(dir_path):

0 commit comments

Comments
 (0)