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
e1b85e06
Commit
e1b85e06
authored
Mar 10, 2022
by
Niall McDaid
Browse files
Update test files
parent
eca7513d
Changes
9
Hide whitespace changes
Inline
Side-by-side
src/test/test_configuration.py
View file @
e1b85e06
...
...
@@ -5,8 +5,8 @@ from unittest.mock import Mock
from
.
import
TARGET_MODULE_NAME
# Test target module import
Configuration
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.configuration"
).
Configuration
IFileLoader
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.file_loader"
).
IFileLoader
Configuration
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
configuration"
).
Configuration
IFileLoader
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
file_loader"
).
IFileLoader
class
TestConfiguration
:
...
...
src/test/test_environment_var_helper.py
View file @
e1b85e06
...
...
@@ -4,7 +4,7 @@ import importlib
from
.
import
TARGET_MODULE_NAME
# Test target module import
environment_var_helper
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.environment_var_helper"
)
environment_var_helper
=
importlib
.
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
wrapper.
environment_var_helper"
)
EnvironmentVarHelper
=
environment_var_helper
.
EnvironmentVarHelper
MissingArgumentError
=
environment_var_helper
.
MissingArgumentError
...
...
src/test/test_file_loader.py
View file @
e1b85e06
...
...
@@ -4,7 +4,7 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
# Test target module import
file_loader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.file_loader"
)
file_loader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
file_loader"
)
LasParser
=
file_loader
.
LasParser
FileValidationError
=
file_loader
.
FileValidationError
LocalFileLoader
=
file_loader
.
LocalFileLoader
...
...
src/test/test_json_writer.py
View file @
e1b85e06
...
...
@@ -6,7 +6,7 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
# Test target module import
JsonToFile
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.json_writer"
).
JsonToFile
JsonToFile
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
wrapper.
json_writer"
).
JsonToFile
class
TestJsonToFile
(
unittest
.
TestCase
):
...
...
src/test/test_osdu_client.py
View file @
e1b85e06
...
...
@@ -5,8 +5,8 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
# Test target module import
Record
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.record_mapper"
).
Record
osdu_client
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.osdu_client"
)
Record
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
service.
record_mapper"
).
Record
osdu_client
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
wrapper.
osdu_client"
)
DataLoaderWebResponseError
=
osdu_client
.
DataLoaderWebResponseError
OsduClient
=
osdu_client
.
OsduClient
...
...
src/test/test_property_mapping.py
View file @
e1b85e06
...
...
@@ -5,16 +5,16 @@ from . import TARGET_MODULE_NAME
# Test target module import
property_mapping
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.property_mapping"
)
property_mapping
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
service.
property_mapping"
)
PropertyMapper
=
property_mapping
.
PropertyMapper
IPropertyMappingLoader
=
property_mapping
.
IPropertyMappingLoader
IDictionaryLoader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.file_loader"
).
IDictionaryLoader
WdutilValidationException
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.exceptions"
).
WbdutilValidationException
WbdutilAttributeError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.exceptions"
).
WbdutilAttributeError
Configuration
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.configuration"
).
Configuration
IFileLoader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.file_loader"
).
IFileLoader
IDictionaryLoader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
file_loader"
).
IDictionaryLoader
WdutilValidationException
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
exceptions"
).
WbdutilValidationException
WbdutilAttributeError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
exceptions"
).
WbdutilAttributeError
Configuration
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
configuration"
).
Configuration
IFileLoader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
file_loader"
).
IFileLoader
class
TestPropertyMapper
:
...
...
@@ -23,7 +23,7 @@ class TestPropertyMapper:
mapping
=
{
"xyz"
:
"abc"
,
"uvw"
:
"ef"
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -45,7 +45,7 @@ class TestPropertyMapper:
"dest1"
:
"level1a.level2.level3"
,
"dest2"
:
"level1b.level2"
,
"dest3"
:
"level1a"
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -74,7 +74,7 @@ class TestPropertyMapper:
"dest1"
:
"level1a.level2.level4"
,
"dest2"
:
"level1b.level2"
,
"dest3"
:
"level1a"
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -102,7 +102,7 @@ class TestPropertyMapper:
mapping
=
{
"level1.level2.a"
:
"a"
,
"level1.b"
:
"b"
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -122,7 +122,7 @@ class TestPropertyMapper:
# Arrange
mapping
=
{
"dest"
:
"src[1]"
,
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -158,7 +158,7 @@ class TestPropertyMapper:
# Arrange
mapping
=
{
"dest"
:
"src[0][1].nest[1].value"
,
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
@@ -176,7 +176,7 @@ class TestPropertyMapper:
# Arrange
mapping
=
{
"dest"
:
"src[a]"
,
}
}
target
=
self
.
_construct_property_mapper
(
mapping
)
...
...
src/test/test_record_mapper.py
View file @
e1b85e06
...
...
@@ -6,18 +6,18 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
# Test target module import
record_mapper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.record_mapper"
)
record_mapper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
service.
record_mapper"
)
Record
=
record_mapper
.
Record
LasToRecordMapper
=
record_mapper
.
LasToRecordMapper
WellLogRecord
=
record_mapper
.
WellLogRecord
MappingUtilities
=
record_mapper
.
MappingUtilities
MapWellLogToLas
=
record_mapper
.
MapWellLogToLas
file_loader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.file_loader"
)
file_loader
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
file_loader"
)
LasParser
=
file_loader
.
LasParser
LocalFileLoader
=
file_loader
.
LocalFileLoader
Configuration
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.configuration"
).
Configuration
Configuration
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
configuration"
).
Configuration
@
pytest
.
fixture
...
...
@@ -53,7 +53,7 @@ def config_incomplete():
@
pytest
.
fixture
def
record_mapper
(
las
):
return
LasToRecordMapper
(
las
,
Configuration
(
LocalFileLoader
(),
"test/test-config-files/config_example.json"
))
return
LasToRecordMapper
(
las
,
Configuration
(
LocalFileLoader
(),
"test/test-config-files/config_example.json"
))
@
pytest
.
fixture
...
...
@@ -80,7 +80,7 @@ class TestLasToRecordMapper:
def
test_record_mapper_raises_FileNotFoundError_when_config_file_not_found
(
self
,
las
):
with
pytest
.
raises
(
FileNotFoundError
):
LasToRecordMapper
(
las
,
Configuration
(
LocalFileLoader
(),
"a/non/existent/file/path/config.json"
))
LasToRecordMapper
(
las
,
Configuration
(
LocalFileLoader
(),
"a/non/existent/file/path/config.json"
))
def
test_wellbore_mapping_returns_Record_object_containing_formatted_config_variables
(
self
,
record_mapper
):
# Arrange
...
...
src/test/test_reflection_utilities.py
View file @
e1b85e06
...
...
@@ -3,9 +3,9 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
ReflectionHelper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.reflection_utilities"
).
ReflectionHelper
WbdutilAttributeError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.exceptions"
).
WbdutilAttributeError
WbdutilValueError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.exceptions"
).
WbdutilValueError
ReflectionHelper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
reflection_utilities"
).
ReflectionHelper
WbdutilAttributeError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
exceptions"
).
WbdutilAttributeError
WbdutilValueError
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
common.
exceptions"
).
WbdutilValueError
class
TestReflectionHelper
:
...
...
src/test/test_well_service.py
View file @
e1b85e06
...
...
@@ -6,16 +6,16 @@ from importlib import import_module
from
.
import
TARGET_MODULE_NAME
# Test target module import
well_service
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.well_service"
)
well_service
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
service.
well_service"
)
WellBoreService
=
well_service
.
WellBoreService
WellLogService
=
well_service
.
WellLogService
DataLoaderConflictError
=
well_service
.
DataLoaderConflictError
osdu_client
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.osdu_client"
)
osdu_client
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
wrapper.
osdu_client"
)
DataLoaderWebResponseError
=
osdu_client
.
DataLoaderWebResponseError
OsduClient
=
osdu_client
.
OsduClient
record_mapper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.record_mapper"
)
record_mapper
=
import_module
(
f
"
{
TARGET_MODULE_NAME
}
.
service.
record_mapper"
)
LasToRecordMapper
=
record_mapper
.
LasToRecordMapper
Record
=
record_mapper
.
Record
WellLogRecord
=
record_mapper
.
WellLogRecord
...
...
Write
Preview
Supports
Markdown
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