Commit e1b85e06 authored by Niall McDaid's avatar Niall McDaid
Browse files

Update test files

parent eca7513d
......@@ -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:
......
......@@ -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
......
......@@ -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
......
......@@ -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):
......
......@@ -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
......
......@@ -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)
......
......@@ -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
......
......@@ -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:
......
......@@ -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
......
Supports Markdown
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