#NEWLINE# @ mock . patch ( 'rally.deployment.serverprovider.providers.virsh.netaddr.IPAddress' ) #NEWLINE# @ mock . patch ( 'rally.deployment.serverprovider.providers.virsh.subprocess' ) #NEWLINE# @ mock . patch ( 'time.sleep' ) #NEWLINE# def test_create_vm_ip_failed( self , mock_sleep , mock_subprocess , mock_ip_address ) : #NEWLINE# #INDENT# mock_ip_address . side_effect = netaddr . core . AddrFormatError #NEWLINE# server = self . provider . create_vm ( 'name' ) #NEWLINE# mock_subprocess . assert_has_calls ( ( 3 * [ mock . call . check_output ( [ 'ssh' , '-o StrictHostKeyChecking=no' , 'user@host' , './get_domain_ip.sh' , 'name' ] ) ] ) ) #NEWLINE# self . assertEqual ( server . host , 'None' )