Commit 4a463a11 authored by Niall McDaid's avatar Niall McDaid
Browse files

Tests and linting corrections

parent 9ae3c70b
......@@ -71,7 +71,8 @@ class LasCommandLoader(CLICommandsLoader):
with ArgumentsContext(self, '') as arg_context:
arg_context.argument('config_path', type=str, options_list=('-c', '--config_path'),
help='The path and filename of the configuration file. Defaults to \'CONFIGPATH\' environment variable if not set.')
help='''The path and filename of the configuration file.
Defaults to \'CONFIGPATH\' environment variable if not set.''')
# 'fileload'
with ArgumentsContext(self, 'fileload') as arg_context:
......@@ -153,7 +154,8 @@ class LasCommandLoader(CLICommandsLoader):
def _register_token_argument(self, arg_context):
arg_context.argument('token', type=str, options_list=('-t', '--token'),
help='A valid bearer token used to authenticate with the OSDU instance. Defaults to \'OSDUTOKEN\' environment variable if not set.')
help='''A valid bearer token used to authenticate with the OSDU instance.
Defaults to \'OSDUTOKEN\' environment variable if not set.''')
def main():
......
import pytest
from lasloader.command_utils import validate_token_and_config_path
def test_validate_token_and_config_path_returns_true_when_vars_not_None():
token = "an_example_token_string"
config_path = "path/to/config/file.json"
assert validate_token_and_config_path(token, config_path)
@pytest.mark.parametrize("token, config_path", [(None, None), (None, "path/to/file"), ("a token", None)])
def test_validate_token_and_config_path_returns_false_when_vars_None(token, config_path):
assert not validate_token_and_config_path(token, config_path)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment