Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
Data Flow
Data Loading
Wellbore DDMS Data Loader
Commits
4a463a11
Commit
4a463a11
authored
Nov 09, 2021
by
Niall McDaid
Browse files
Tests and linting corrections
parent
9ae3c70b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/lasloader/lascli.py
View file @
4a463a11
...
...
@@ -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
():
...
...
src/test/test_command_utils.py
0 → 100644
View file @
4a463a11
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment