'Test case for updating NetworkInterfaces when no old, no new prop.
Instance.handle_update supports changing the NetworkInterfaces.'

def test_instance_update_network_interfaces_no_old_empty_new(self):

    return_server = self.fc.servers.list()[1]
    return_server.id = '1234'
    instance = self._create_test_instance(return_server, 'ud_network_interfaces')
    self._stub_glance_for_update()
    iface = self.create_fake_iface('d1e9c73c-04fe-4e9e-983c-d5ef94cd1a46', 'c4485ba1-283a-4f5f-8868-0cd46cdda52f', '10.0.0.4')
    update_props = self.instance_props.copy()
    update_props['NetworkInterfaces'] = []
    update_template = instance.t.freeze(properties=update_props)
    self.m.StubOutWithMock(self.fc.servers, 'get')
    self.fc.servers.get('1234').MultipleTimes().AndReturn(return_server)
    self.m.StubOutWithMock(return_server, 'interface_list')
    return_server.interface_list().AndReturn([iface])
    self.m.StubOutWithMock(return_server, 'interface_detach')
    return_server.interface_detach('d1e9c73c-04fe-4e9e-983c-d5ef94cd1a46').AndReturn(None)
    self.m.StubOutWithMock(return_server, 'interface_attach')
    return_server.interface_attach(None, None, None).AndReturn(None)
    self.m.ReplayAll()
    scheduler.TaskRunner(instance.update, update_template)()
    self.assertEqual((instance.UPDATE, instance.COMPLETE), instance.state)
    self.m.VerifyAll()
