#NEWLINE# @ istest #NEWLINE# def gets_user_hosts( self ) : #NEWLINE# #INDENT# with self . execute_mock ( ) as execute : #NEWLINE# #INDENT# execute . return_value = HOSTS_FOR_USER #NEWLINE# hosts = self . role . get_user_hosts ( 'root' ) #NEWLINE# self . assertEqual ( execute , [ '127.0.0.1' , '::1' , 'my-desktop' , 'localhost' ] ) #NEWLINE# execute . assert_called_with ( 'mysql -u root -E -e "select Host from mysql.user where LOWER(User)=\'root\'" mysql' , sudo = True , stdout = False )