def test_ok_to_continue(self): # to do this test, I need to first add the current cache file to the array, then try to check ok to continue, # but then on another thread, wait download_thread = threading.Thread( target=TestCacheFileOKToContinue.block_cache_then_release, args=[self.test_cache_file_path]) c = CF(working_directory=self.temp_dir) download_thread.start() self.assertTrue(c.ok_to_continue())
def test_never_ok_to_continue(self): c = CF(working_directory=self.temp_dir) cache_files_currently_updating_or_writing.append( self.test_cache_file_path) self.assertFalse(c.ok_to_continue())