#NEWLINE# @ istest #NEWLINE# def doesnt_create_vhost_if_it_already_exists( self ) : #NEWLINE# #INDENT# with self . mock_role_methods ( 'vhost_exists' , 'execute' ) : #NEWLINE# #INDENT# self . role . vhost_exists . return_value = True #NEWLINE# result = self . role . ensure_vhost ( 'foo-vhost' ) #NEWLINE# self . assertFalse ( result ) #NEWLINE# self . role . vhost_exists . assert_called_once_with ( 'foo-vhost' ) #NEWLINE# self . assertFalse ( self . role . execute . called )