tests: rename function
@@ -16,14 +16,14 @@ def workdir(tmp_path):
return d
-def command_runner(command, exit_code=0):
+def execute(command, exit_code=0):
runner = CliRunner()
result = runner.invoke(cli, command)
assert result.exit_code == exit_code
return result.output
-def command_client_runner(tmpdir, command, exit_code=0):
+def client_execute(tmpdir, command, exit_code=0):
# force using a new config file and a new profile
if '--config' not in command:
cfgpath = tmpdir / 'substra.cfg'
@@ -35,16 +35,16 @@ def command_client_runner(tmpdir, command, exit_code=0):
}
substra.config.add_profile(str(cfgpath), 'default', profile)
command.extend(['--config', str(cfgpath)])
- return command_runner(command, exit_code=exit_code)
+ return execute(command, exit_code=exit_code)
def test_command_help():
- output = command_runner(['--help'])
+ output = execute(['--help'])
assert 'Usage:' in output
def test_command_version():
- output = command_runner(['--version'])
+ output = execute(['--version'])
assert substra.__version__ in output
@@ -55,7 +55,7 @@ def test_command_config(workdir):
new_url = 'http://toto'
new_profile = 'toto'
- command_runner([
+ execute([
'config',
new_url,
'--profile', new_profile,
@@ -79,7 +79,7 @@ def mock_client_call(mocker, method_name, response):
def test_command_list(workdir, mocker):
response = [datastore.OBJECTIVE]
with mock_client_call(mocker, 'list', response) as m:
- output = command_client_runner(workdir, [
+ output = client_execute(workdir, [
'list', 'objective',
])
assert m.is_called()
@@ -89,7 +89,7 @@ def test_command_list(workdir, mocker):
def test_command_get(workdir, mocker):
response = datastore.OBJECTIVE
with mock_client_call(mocker, 'get', response) as m:
- output = command_client_runner(workdir, [
+ output = client_execute(workdir, [
'get', 'objective', 'fakekey'
])
assert m.is_called()
