'Test case when check_create_complete should raise error.
check_create_complete should raise error when create task is
done but the nested stack is not in (<action>,COMPLETE) state'

def test_state_err(self):

    self.status[1] = 'FAILED'
    reason = ('Resource    %s    failed:    ValueError:    resources.%s:    broken    on    purpose' % (self.action.upper(), 'child_res'))
    exp_path = 'resources.test.resources.child_res'
    exp = ('ValueError:    %s:    broken    on    purpose' % exp_path)
    self.status[2] = reason
    complete = getattr(self.parent_resource, ('check_%s_complete' % self.action))
    exc = self.assertRaises(exception.ResourceFailure, complete, None)
    self.assertEqual(exp, six.text_type(exc))
    self.mock_status.assert_called_once_with(self.parent_resource.context, self.parent_resource.resource_id)
