#NEWLINE# def test_create( self ) : #NEWLINE# #INDENT# 'Create domain.' #NEWLINE# xml = '<domain></domain>' #NEWLINE# expected = ( '<domain><name>foo</name><uuid>foo</uuid><devices><disk device="disk" type="file">' + '<source file="/diskpath.vdi" /></disk></devices></domain>' ) #NEWLINE# hypervisor = mock . Mock ( ) #NEWLINE# hypervisor . listNetworks . return_value = [ ] #NEWLINE# with mock . patch ( 'see.context.resources.vbox.open' , mock . mock_open ( read_data = xml ) , create = True ) : #NEWLINE# #INDENT# vbox . domain_create ( hypervisor , 'foo' , { #NEWLINE# #INDENT# 'configuration' : '/foo' , #NEWLINE# #UNINDENT# } , '/diskpath.vdi' ) #NEWLINE# #UNINDENT# results = hypervisor . defineXML . call_args_list [ 0 ] [ 0 ] [ 0 ] #NEWLINE# self . assertEqual ( results , expected , compare ( results , expected ) )