def run_unafold_bad_permissions_test(): # If we do not have permissions to write to the UNAfold # directory, we need to trhow a runtimeError temp_dir = tempfile.mkdtemp() subprocess.call(["chmod", "a-w", temp_dir]) try: weboutput.run_unafold(temp_dir, "ATTA") finally: shutil.rmtree(temp_dir)
def run_unafold_missing_binary_test(): # Verify that we throw a runtime error if unafold.pl # binary is missing. bad_command = "/tmp/does_not_exist" temp_dir = tempfile.mkdtemp() try: weboutput.run_unafold(os.path.join("/tmp", "ATTAA"), "ATTAA", bad_command ) finally: shutil.rmtree(temp_dir)
def run_unafold_missing_unafolddir_test(): # If we call unafold and temp_directory # does not exist, then it should throw a # RuntimeError temp_dir = "/tmp/does_not_exist" weboutput.run_unafold(temp_dir, "ATATA")