tests.file_system package

Submodules

tests.file_system.test_element_data module

class TestElementalData[source]

Bases: object

CUSTOM_CONFIG_PATH: str = 'tests/resources/configs/elemental-data.yml'
DATA_CUBE_CSV: str = 'test.csv'
DATA_CUBE_DMS: str = 'test.dms'
ELEMENTS: list[str] = ['Secret', 'Element']
NAME_CUBE_FROM_CSV: str = 'cube_from_csv'
NON_EXISTING_CUBE: str = 'non-existing.dms'
PATH_TO_TEST_FOLDER: str = 'tests/resources/file_system/test_elemental_data'
RAW_ELEMENTAL_CUBE: ndarray = array([[[-1., -2., -3.],         [-4., -5., -6.],         [-7., -8., -9.]],         [[ 1.,  2.,  3.],         [ 4.,  5.,  6.],         [ 7.,  8.,  9.]]], dtype=float32)
SOURCE_FOLDER_CSV: str = 'csv'
SOURCE_FOLDER_DMS: str = 'dms'
do_test_get_element_names(source, caplog)[source]
do_test_get_elemental_cube(source, caplog)[source]
do_test_get_elemental_map(source, caplog)[source]
setup_environment()[source]
test_csv_to_dms(caplog)[source]
test_csv_to_dms_directly(caplog)[source]
test_get_element_averages(caplog)[source]
test_get_element_averages_invalid_data_source(caplog)[source]
test_get_element_averages_selection(caplog)[source]
test_get_element_names(caplog)[source]
test_get_element_names_invalid_data_source(caplog)[source]
test_get_elemental_cube(caplog)[source]
test_get_elemental_map(caplog)[source]
test_get_elemental_map_invalid_type(caplog)[source]
test_get_short_element_names_invalid_data_source(caplog)[source]
test_to_dms_cube_name_includes_file_extension(caplog)[source]
test_to_dms_invalid_folder_path(caplog)[source]

tests.file_system.test_file_upload module

class TestUploadFileToServer[source]

Bases: object

CUSTOM_CONFIG_PATH: str = 'tests/resources/configs/upload-file-server-backend.yml'
CUSTOM_CONFIG_PATH_NO_SOURCES: str = 'tests/resources/configs/upload-file-server-backend-no-sources.yml'
UPLOAD_FILE_PATH: str = 'tests/resources/file_system/txt-file.txt'
static get_filestorage_object(path: str)[source]
test_get_data_source_files(caplog)[source]
test_get_data_source_files_invalid_config()[source]
test_get_data_source_files_invalid_path()[source]
test_get_data_source_names_invalid_config()[source]
test_get_file_names()[source]
test_no_file_names()[source]

tests.file_system.test_spectral module

class TestSpectral[source]

Bases: object

CUSTOM_CONFIG_PATH: str = 'tests/resources/configs/spectra.yml'
DATA_SOURCE_FOLDER_NAME: str = 'spectra_source'
EMPTY_SOURCE_NAME: str = 'empty_source'
NO_OFFSET_NAME: str = 'no_offset_source'
NO_RAW_SOURCE_NAME: str = 'no_raw_source'
NO_WORKSPACE_NAME: str = 'wo_workspace_source'
RESOURCES_PATH: Path = PosixPath('tests/resources')
TEST_RAW_PATH: str = 'tests/resources/spectra/data/spectra_source/data.raw'
WRONG_SIZE_NAME: str = 'wrong_size_source'
numpy_to_raw(array: ndarray, path: str)[source]

Writes a numpy array to a raw file.

Parameters:
  • array – The array to write.

  • path – The path to write the file to.

setup_environment()[source]
test_bin_data_()[source]
test_bin_data_default_params()[source]
test_bin_data_empty_rpl(caplog)[source]
test_bin_data_identity()[source]
test_bin_data_no_raw(caplog)[source]
test_bin_data_wrong_size(caplog)[source]
test_get_spectra_params()[source]
test_get_spectra_params_file_not_found()[source]
test_parse_rpl()[source]
test_parse_rpl_empty_file(caplog)[source]
test_parse_rpl_file_not_found(caplog)[source]
test_update_bin_params()[source]
test_update_bin_params_default()[source]
test_update_bin_params_no_offset()[source]

tests.file_system.test_workspace_handler module

class TestWorkspaceHandler[source]

Bases: object

CUSTOM_CONFIG_PATH: str = 'tests/resources/configs/workspace_handler.yml'
CUSTOM_DATA_FOLDER: str = 'tests/resources/file_system/test_workspace_handler'
DATASOURCE_NAME: str = 'a_datasource'
DATASOURCE_NAME_NO_WORKSPACE: str = 'no_datasource'
ELEMENTAL_CUBE_NAME: str = 'elemental cube'
test_config_not_found_get_workspace(caplog)[source]
test_config_not_found_update_workspace(caplog)[source]
test_datasource_not_found_get_workspace(caplog)[source]
test_datasource_not_found_update_workspace(caplog)[source]
test_get_base_image_name()[source]
test_get_base_image_name_no_config(caplog)[source]
test_get_base_image_name_no_workspace()[source]
test_get_base_image_path_no_config(caplog)[source]
test_get_base_image_path_no_filepath()[source]
test_get_elemental_cube_path_from_name_invalid_name(caplog)[source]
test_get_elemental_cube_path_from_name_no_config(caplog)[source]
test_get_elemental_cube_path_from_name_no_workspace()[source]
test_get_get_workspace_dict_no_config(caplog)[source]
test_get_spectral_cube_recipe_path_no_config(caplog)[source]
test_get_spectral_cube_recipe_path_no_workspace()[source]
test_update_workspace(caplog)[source]
test_workspace_found(caplog)[source]

Module contents