def test_is_deleted_fail(self, mock_resource_manager__manager): mock_resource_manager__manager().get.side_effect = TypeError() flavor = resources.NovaFlavors() flavor.raw_resource = mock.MagicMock() self.assertRaises(TypeError, flavor.is_deleted)
def test_is_deleted(self, mock_resource_manager__manager): exc = nova_exc.NotFound(404) mock_resource_manager__manager().get.side_effect = exc flavor = resources.NovaFlavors() flavor.raw_resource = mock.MagicMock() self.assertTrue(flavor.is_deleted())