# Path: heatclient/common/base.py
# def getid(obj):
#     def add_hook(cls, hook_type, hook_func):
#     def run_hooks(cls, hook_type, *args, **kwargs):
#     def __init__(self, client):
#     def _list(self, url, response_key=None, obj_class=None, json=None):
#     def _get(self, url, response_key=None):
#     def _head(self, url):
#     def _post(self, url, json, response_key=None, return_raw=False):
#     def _put(self, url, json=None, response_key=None):
#     def _patch(self, url, json=None, response_key=None):
#     def _delete(self, url):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def build_url(self, base_url=None, **kwargs):
#     def _filter_kwargs(self, kwargs):
#     def create(self, **kwargs):
#     def get(self, **kwargs):
#     def head(self, **kwargs):
#     def list(self, base_url=None, **kwargs):
#     def put(self, base_url=None, **kwargs):
#     def update(self, **kwargs):
#     def delete(self, **kwargs):
#     def find(self, base_url=None, **kwargs):
#     def __init__(self, name, module):
#     def _parse_extension_module(self):
#     def __repr__(self):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def human_id(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_same_obj(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class HookableMixin(object):
# class BaseManager(HookableMixin):
# class ManagerWithFind(BaseManager):
# class CrudManager(BaseManager):
# class Extension(HookableMixin):
# class Resource(object):
#     SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
#     HUMAN_ID = False
#     NAME_ATTR = 'name'
# 
# Path: heatclient/v1/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):
# 
# Path: heatclient/v1/stacks.py
# class Stack(base.Resource):
# class StackChildManager(base.BaseManager):
# class StackManager(StackChildManager):
#     def __repr__(self):
#     def preview(self, **fields):
#     def create(self, **fields):
#     def update(self, **fields):
#     def delete(self):
#     def abandon(self):
#     def snapshot(self, name=None):
#     def snapshot_show(self, snapshot_id):
#     def snapshot_delete(self, snapshot_id):
#     def restore(self, snapshot_id):
#     def snapshot_list(self):
#     def output_list(self):
#     def output_show(self, output_key):
#     def environment(self):
#     def files(self):
#     def get(self):
#     def action(self):
#     def status(self):
#     def identifier(self):
#     def api(self):
#     def _resolve_stack_id(self, stack_id):
#     def list(self, **kwargs):
#         def paginate(params):
#     def preview(self, **kwargs):
#     def create(self, **kwargs):
#     def update(self, stack_id, **kwargs):
#     def preview_update(self, stack_id, **kwargs):
#     def delete(self, stack_id):
#     def abandon(self, stack_id):
#     def export(self, stack_id):
#     def snapshot(self, stack_id, name=None):
#     def snapshot_show(self, stack_id, snapshot_id):
#     def snapshot_delete(self, stack_id, snapshot_id):
#     def restore(self, stack_id, snapshot_id):
#     def snapshot_list(self, stack_id):
#     def output_list(self, stack_id):
#     def output_show(self, stack_id, output_key):
#     def get(self, stack_id, resolve_outputs=True):
#     def template(self, stack_id):
#     def environment(self, stack_id):
#     def files(self, stack_id):
#     def validate(self, **kwargs):


import testtools
from heatclient.common import base
from heatclient.v1 import events
from heatclient.v1 import stacks
        self.assertEqual(r1, r2)

    def test_two_resources_with_diff_type_are_not_equal(self):
        # Two resoruces of different types: never equal
        r1 = base.Resource(None, {'id': 1})
        r2 = events.Event(None, {'id': 1})
        self.assertNotEqual(r1, r2)

    def test_two_resources_with_no_id_are_equal(self):
        # Two resources with no ID: equal if their info is equal
        r1 = base.Resource(None, {'name': 'joe', 'age': 12})
        r2 = base.Resource(None, {'name': 'joe', 'age': 12})
        self.assertEqual(r1, r2)

    def test_is_same_object(self):
        # Two resources with same type and same ID: is same object
        r1 = base.Resource(None, {'id': 1, 'name': 'hi'})
        r2 = base.Resource(None, {'id': 1, 'name': 'hello'})
        self.assertTrue(r1.is_same_obj(r2))
        self.assertTrue(r2.is_same_obj(r1))

    def test_is_diff_object_with_diff_id(self):
        # Two resources with same type and different ID: is different object
        r1 = base.Resource(None, {'id': 1, 'name': 'hello'})
        r2 = base.Resource(None, {'id': 2, 'name': 'hello'})
        self.assertFalse(r1.is_same_obj(r2))
        self.assertFalse(r2.is_same_obj(r1))

    def test_is_diff_object_with_diff_type(self):
        # Two resources with different types: is different object

# Path: heatclient/common/base.py
# def getid(obj):
#     def add_hook(cls, hook_type, hook_func):
#     def run_hooks(cls, hook_type, *args, **kwargs):
#     def __init__(self, client):
#     def _list(self, url, response_key=None, obj_class=None, json=None):
#     def _get(self, url, response_key=None):
#     def _head(self, url):
#     def _post(self, url, json, response_key=None, return_raw=False):
#     def _put(self, url, json=None, response_key=None):
#     def _patch(self, url, json=None, response_key=None):
#     def _delete(self, url):
#     def list(self):
#     def find(self, **kwargs):
#     def findall(self, **kwargs):
#     def build_url(self, base_url=None, **kwargs):
#     def _filter_kwargs(self, kwargs):
#     def create(self, **kwargs):
#     def get(self, **kwargs):
#     def head(self, **kwargs):
#     def list(self, base_url=None, **kwargs):
#     def put(self, base_url=None, **kwargs):
#     def update(self, **kwargs):
#     def delete(self, **kwargs):
#     def find(self, base_url=None, **kwargs):
#     def __init__(self, name, module):
#     def _parse_extension_module(self):
#     def __repr__(self):
#     def __init__(self, manager, info, loaded=False):
#     def __repr__(self):
#     def human_id(self):
#     def _add_details(self, info):
#     def __getattr__(self, k):
#     def get(self):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def is_same_obj(self, other):
#     def is_loaded(self):
#     def set_loaded(self, val):
#     def to_dict(self):
# class HookableMixin(object):
# class BaseManager(HookableMixin):
# class ManagerWithFind(BaseManager):
# class CrudManager(BaseManager):
# class Extension(HookableMixin):
# class Resource(object):
#     SUPPORTED_HOOKS = ('__pre_parse_args__', '__post_parse_args__')
#     HUMAN_ID = False
#     NAME_ATTR = 'name'
# 
# Path: heatclient/v1/events.py
# DEFAULT_PAGE_SIZE = 20
# class Event(base.Resource):
# class EventManager(stacks.StackChildManager):
#     def __repr__(self):
#     def update(self, **fields):
#     def delete(self):
#     def data(self, **kwargs):
#     def list(self, stack_id, resource_name=None, **kwargs):
#     def get(self, stack_id, resource_name, event_id):
# 
# Path: heatclient/v1/stacks.py
# class Stack(base.Resource):
# class StackChildManager(base.BaseManager):
# class StackManager(StackChildManager):
#     def __repr__(self):
#     def preview(self, **fields):
#     def create(self, **fields):
#     def update(self, **fields):
#     def delete(self):
#     def abandon(self):
#     def snapshot(self, name=None):
#     def snapshot_show(self, snapshot_id):
#     def snapshot_delete(self, snapshot_id):
#     def restore(self, snapshot_id):
#     def snapshot_list(self):
#     def output_list(self):
#     def output_show(self, output_key):
#     def environment(self):
#     def files(self):
#     def get(self):
#     def action(self):
#     def status(self):
#     def identifier(self):
#     def api(self):
#     def _resolve_stack_id(self, stack_id):
#     def list(self, **kwargs):
#         def paginate(params):
#     def preview(self, **kwargs):
#     def create(self, **kwargs):
#     def update(self, stack_id, **kwargs):
#     def preview_update(self, stack_id, **kwargs):
#     def delete(self, stack_id):
#     def abandon(self, stack_id):
#     def export(self, stack_id):
#     def snapshot(self, stack_id, name=None):
#     def snapshot_show(self, stack_id, snapshot_id):
#     def snapshot_delete(self, stack_id, snapshot_id):
#     def restore(self, stack_id, snapshot_id):
#     def snapshot_list(self, stack_id):
#     def output_list(self, stack_id):
#     def output_show(self, stack_id, output_key):
#     def get(self, stack_id, resolve_outputs=True):
#     def template(self, stack_id):
#     def environment(self, stack_id):
#     def files(self, stack_id):
#     def validate(self, **kwargs):


# Path: heatclient/tests/unit/test_openstack_common.py
import testtools
from heatclient.common import base
from heatclient.v1 import events
from heatclient.v1 import stacks

        self.assertEqual(r1, r2)

    def test_two_resources_with_diff_type_are_not_equal(self):
        # Two resoruces of different types: never equal
        r1 = base.Resource(None, {'id': 1})
        r2 = events.Event(None, {'id': 1})
        self.assertNotEqual(r1, r2)

    def test_two_resources_with_no_id_are_equal(self):
        # Two resources with no ID: equal if their info is equal
        r1 = base.Resource(None, {'name': 'joe', 'age': 12})
        r2 = base.Resource(None, {'name': 'joe', 'age': 12})
        self.assertEqual(r1, r2)

    def test_is_same_object(self):
        # Two resources with same type and same ID: is same object
        r1 = base.Resource(None, {'id': 1, 'name': 'hi'})
        r2 = base.Resource(None, {'id': 1, 'name': 'hello'})
        self.assertTrue(r1.is_same_obj(r2))
        self.assertTrue(r2.is_same_obj(r1))

    def test_is_diff_object_with_diff_id(self):
        # Two resources with same type and different ID: is different object
        r1 = base.Resource(None, {'id': 1, 'name': 'hello'})
        r2 = base.Resource(None, {'id': 2, 'name': 'hello'})
        self.assertFalse(r1.is_same_obj(r2))
        self.assertFalse(r2.is_same_obj(r1))

    def test_is_diff_object_with_diff_type(self):
        # Two resources with different types: is different object

        r1 = events.Event(None, {'id': 1})