Use assertRaises() to check specific exception
Use assertRaises() to check specific exception

In test_run_terminate_deallocate_net_failure_sets_error_state(),

        ......

        try:
            self.compute.terminate_instance(self.context, instance, [], [])
        except test.TestingException:
            pass

        ......

The block aims at ensuring that terminate_instance() raises TestingException.
But this is incorrect because if TestingException is not raised by
terminate_instance(), which means if the terminate_instance() finishes normally,
the block will pass too.

This patch fixes it by using assertRaises() to check the exception.

Change-Id: I06aba3fe1199e500565d1251b180ce6ca1d4aec1

sebrandon1/nova,openstack/nova,CEG-FYP-OpenStack/scheduler,klmitch/nova,NeCTAR-RC/nova,bigswitch/nova,BeyondTheClouds/nova,vmturbo/nova,rajalokan/nova,gooddata/openstack-nova,sebrandon1/nova,vmturbo/nova,jianghuaw/nova,mikalstill/nova,cernops/nova,openstack/nova,cloudbase/nova,openstack/nova,mikalstill/nova,hanlind/nova,bigswitch/nova,NeCTAR-RC/nova,Juniper/nova,rajalokan/nova,sebrandon1/nova,rahulunair/nova,cyx1231st/nova,cernops/nova,hanlind/nova,cloudbase/nova,jianghuaw/nova,alaski/nova,zhimin711/nova,rajalokan/nova,klmitch/nova,mikalstill/nova,gooddata/openstack-nova,BeyondTheClouds/nova,gooddata/openstack-nova,klmitch/nova,jianghuaw/nova,mahak/nova,vmturbo/nova,jianghuaw/nova,Juniper/nova,BeyondTheClouds/nova,CEG-FYP-OpenStack/scheduler,klmitch/nova,mahak/nova,rahulunair/nova,phenoxim/nova,Juniper/nova,phenoxim/nova,zhimin711/nova,rajalokan/nova,cernops/nova,alaski/nova,gooddata/openstack-nova,cyx1231st/nova,Juniper/nova,cloudbase/nova,hanlind/nova,vmturbo/nova,rahulunair/nova,mahak/nova