#NEWLINE# @ then ( 'there is a temporary job for the service {service} and instance {instance}' ) #NEWLINE# def temporary_job_exists( context , service , instance ) : #NEWLINE# #INDENT# all_jobs = context . chronos_client . list ( ) #NEWLINE# matching_jobs = [ job for job in all_jobs if re . match ( ( '%s-.* %s %s' % ( chronos_tools . TMP_JOB_IDENTIFIER , service , instance ) ) , job [ 'name' ] ) ] #NEWLINE# assert ( len ( matching_jobs ) == 1 )