[docs]deftest_register_image_to_image_reference_not_found(self,caplog):result:bool=register_image_to_image("made/up/path",self.PATH_IMAGE_REGISTER,self.PATH_CUBE,self.PATH_RESULT,)assertnotresultassertnotexists(self.PATH_RESULT)assert"Reference image could not be loaded"incaplog.text
[docs]deftest_register_image_to_image_register_not_found(self,caplog):result:bool=register_image_to_image(self.PATH_IMAGE_REFERENCE,"some/random/non/existent/path",self.PATH_CUBE,self.PATH_RESULT,)assertnotresultassertnotexists(self.PATH_RESULT)assert"Image for registering could not be loaded"incaplog.text
[docs]deftest_register_image_to_image_csv_not_found(self,caplog):result:bool=register_image_to_image(self.PATH_IMAGE_REFERENCE,self.PATH_IMAGE_REGISTER,"made/up/path",self.PATH_RESULT,)assertnotresultassertnotexists(self.PATH_RESULT)assert"Control points file could not be found at made/up/path"incaplog.text
[docs]deftest_register_image_to_image_destination_not_found(self,caplog):# setupinvalid_path:str="tests/resources/image_registration/unexistantdir"# executeresult:bool=register_image_to_image(self.PATH_IMAGE_REFERENCE,self.PATH_IMAGE_REGISTER,self.PATH_CONTROL_POINTS,join(invalid_path,"result.tif"),)# verifyassertnotresultassertnotexists(self.PATH_RESULT)assert(f"Registered image could not be saved at {invalid_path} because directory does not exist."incaplog.text)
[docs]deftest_register_image_to_cube_data_cube_not_found(self,caplog):# setup set_config(self.CONFIG_PATH)# executeresult:MatLike|None=get_image_registered_to_data_cube("not_a_data_source",self.IMAGE_NAME)# verifyassertresultisNoneassert"Failed to register image"incaplog.text
[docs]deftest_register_image_to_cube_image_register_not_found(self,caplog):# setupset_config(self.CONFIG_PATH)# executeresult:MatLike|None=get_image_registered_to_data_cube(self.DATA_SOURCE,"not_an_image_name")# verifyassertresultisNoneassert"Image for registering not found at"incaplog.text
[docs]deftest_register_image_to_cube_success(self,caplog):# setupset_config(self.CONFIG_PATH)caplog.set_level(logging.INFO)# executeresult:MatLike|None=get_image_registered_to_data_cube(self.DATA_SOURCE,self.IMAGE_NAME)# verifyassertresultisnotNoneassertresult.shape==(3,3,3)assert"Removing columns: 1"incaplog.textassert"Registering image to elemental cube"incaplog.text