Skip to content

Commit d186a34

Browse files
claudiolorddutt
authored andcommitted
Fix load_sq_config calls in tests
Signed-off-by: Claudio Lorina <[email protected]>
1 parent a187381 commit d186a34

File tree

7 files changed

+14
-13
lines changed

7 files changed

+14
-13
lines changed

tests/integration/test_rest_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_server_exec():
2121
port = randint(9000, 10000)
2222
# We need to change the port used to avoid conflicts
2323
cfgfile = create_dummy_config_file()
24-
sqcfg = load_sq_config(cfgfile)
24+
sqcfg = load_sq_config(config_file=cfgfile)
2525

2626
if 'rest' not in sqcfg:
2727
sqcfg['rest'] = {'port': port}

tests/integration/test_update_data.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def copytree(src, dst, symlinks=False, ignore=None):
4646
def create_config(t_dir, suzieq_dir):
4747
'''Create dummy config'''
4848
# We need to create a tempfile to hold the config
49-
tmpconfig = load_sq_config(conftest.create_dummy_config_file())
49+
tmpconfig = load_sq_config(config_file=conftest.create_dummy_config_file())
5050
tmpconfig['data-directory'] = f"{t_dir}/parquet"
5151
tmpconfig['service-directory'] = \
5252
f"{suzieq_dir}/{tmpconfig['service-directory']}"
@@ -453,7 +453,8 @@ def _test_data(topology, proto, scenario, testvar):
453453
# pylint: disable=redefined-outer-name
454454
name = f'{topology}_{proto}_{scenario}'
455455
testvar['data-directory'] = f"{parquet_dir}/{name}/parquet-out"
456-
dummy_config = load_sq_config(conftest.create_dummy_config_file())
456+
dummy_config = load_sq_config(
457+
config_file=conftest.create_dummy_config_file())
457458
_test_sqcmds(dummy_config, testvar)
458459

459460

tests/unit/poller/controller/manager/test_static_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def manager_cfg():
4343
"""
4444
args = {}
4545
args['config'] = create_dummy_config_file()
46-
args['config-dict'] = load_sq_config(args['config'])
46+
args['config-dict'] = load_sq_config(config_file=args['config'])
4747
yield args
4848
os.remove(args['config'])
4949

tests/unit/poller/worker/services/test_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def service_for_diff():
2424
"""Init the service for testing the get_diff() function
2525
"""
2626
cfg_file = create_dummy_config_file()
27-
cfg = load_sq_config(cfg_file)
27+
cfg = load_sq_config(config_file=cfg_file)
2828
# Build the shema
2929
schema_dir = cfg['schema-directory']
3030
schema = Schema(schema_dir)

tests/unit/poller/worker/test_worker.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def run_worker_with_mocks(poller: Worker) -> Dict[str, MagicMock]:
8282
def test_worker_object_init_validation(poller_args):
8383
"""Test Poller object user_args validation
8484
"""
85-
cfg = load_sq_config(poller_args.config)
85+
cfg = load_sq_config(config_file=poller_args.config)
8686

8787
# Test invalid ssh config file
8888
poller_args.ssh_config_file = 'invalid'
@@ -98,7 +98,7 @@ def test_worker_object_init_validation(poller_args):
9898
async def test_add_pop_worker_task(poller_args):
9999
"""Test the methods for adding and removing the poller tasks
100100
"""
101-
cfg = load_sq_config(poller_args.config)
101+
cfg = load_sq_config(config_file=poller_args.config)
102102
poller = Worker(poller_args, cfg)
103103
# Test add_poller_task()
104104
tasks = [asyncio.Future(), asyncio.Future()]
@@ -122,7 +122,7 @@ async def test_add_pop_worker_task(poller_args):
122122
async def test_poller_worker_run(poller_args):
123123
"""Check if all the services are launched after calling Poller.run()
124124
"""
125-
cfg = load_sq_config(poller_args.config)
125+
cfg = load_sq_config(config_file=poller_args.config)
126126
poller = Worker(poller_args, cfg)
127127

128128
mks = await run_worker_with_mocks(poller)
@@ -138,7 +138,7 @@ async def test_poller_worker_run(poller_args):
138138
def test_worker_inventory_init(poller_args):
139139
"""Test if all the parameters are correctly passed to the Inventory
140140
"""
141-
cfg = load_sq_config(poller_args.config)
141+
cfg = load_sq_config(config_file=poller_args.config)
142142
poller_args.ssh_config_file = 'config/file'
143143
cfg['poller']['connect-timeout'] = 30
144144
with patch.multiple(Worker, _validate_worker_args=MagicMock()):
@@ -158,7 +158,7 @@ def test_worker_inventory_init_addnl_args(poller_args):
158158
"""Test if all the additional params are actually passed to the
159159
Inventory class init function
160160
"""
161-
cfg = load_sq_config(poller_args.config)
161+
cfg = load_sq_config(config_file=poller_args.config)
162162
poller_args.ssh_config_file = 'config/file'
163163
cfg['poller']['connect-timeout'] = 30
164164
dummy_inventory_class = MagicMock()
@@ -202,7 +202,7 @@ def test_worker_inventory_init_addnl_args(poller_args):
202202
def test_worker_service_manager_init(poller_args):
203203
"""Test if all the parameters are correctly passed to the ServiceManager
204204
"""
205-
cfg = load_sq_config(poller_args.config)
205+
cfg = load_sq_config(config_file=poller_args.config)
206206
poller_args.run_once = 'gather'
207207
cfg['poller']['period'] = 30
208208
poller = Worker(poller_args, cfg)

tests/unit/test_sqconfig_load.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def test_config_validation(monkeypatch):
5656
"""Test the sq config validation
5757
"""
5858

59-
base_cfg = load_sq_config(create_dummy_config_file())
59+
base_cfg = load_sq_config(config_file=create_dummy_config_file())
6060

6161
# not a dict
6262
cfg = []

tests/utilities/update_sqcmds.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def create_config(testvar):
1515
if 'data-directory' in testvar:
1616
# We need to create a tempfile to hold the config
1717
tf = conftest.create_dummy_config_file()
18-
tmpconfig = load_sq_config(tf)
18+
tmpconfig = load_sq_config(config_file=tf)
1919
tmpconfig['data-directory'] = testvar['data-directory']
2020

2121
with open(tf, 'w') as f:

0 commit comments

Comments
 (0)