#NEWLINE# @ mock . patch ( 'nova.db.floating_ip_fixed_ip_associate' ) #NEWLINE# def test_associate( self , associate ) : #NEWLINE# #INDENT# db_fixed = dict ( test_fixed_ip . fake_fixed_ip , network = test_network . fake_network ) #NEWLINE# associate . return_value = db_fixed #NEWLINE# floatingip = floating_ip . FloatingIP . associate ( self . context , '172.17.0.1' , '192.168.1.1' , 'host' ) #NEWLINE# associate . assert_called_with ( self . context , '172.17.0.1' , '192.168.1.1' , 'host' ) #NEWLINE# self . assertEqual ( db_fixed [ 'id' ] , floatingip . fixed_ip . id ) #NEWLINE# self . assertEqual ( '172.17.0.1' , str ( floatingip . address ) ) #NEWLINE# self . assertEqual ( 'host' , floatingip . host )