def test_fail_no_base(self): lang = Translations() lib = TargetSearch(lang, InfoRam(lang), DataRam(lang)) try: lib.get_final_target_name() assert False, 'No final target name and passed' except UploadException as ex: assert 'UPLOAD FILE NAME IS EMPTY' == ex.get_message()
def test_fail_no_target(self): lang = Translations() lib = TargetSearch(lang, InfoRam(lang), DataRam(lang)) lib.set_remote_file_name('abcdefg') try: lib.process() assert False, 'No target and passed' except UploadException as ex: assert 'TARGET DIR IS NOT SET' == ex.get_message()
def test_process_no_clear(self): lang = Translations() lib = TargetSearch(lang, InfoRam(lang), DataRam(lang), False, False) lib.set_target_dir(self._get_test_dir()).set_remote_file_name( 'what el$e can be found').process() assert 'what el$e can be found' == lib.get_final_target_name() assert self._get_test_dir( ) + 'what el$e can be found' + TargetSearch.FILE_DRIVER_SUFF == lib.get_driver_location( ) assert self._get_test_dir( ) + 'what el$e can be found' + TargetSearch.FILE_UPLOAD_SUFF == lib.get_temporary_target_location( )