# Path: anchorhub/util/hasattrs.py
# def hasattrs(object, *names):
#     """
#     Takes in an object and a variable length amount of named attributes,
#     and checks to see if the object has each property. If any of the
#     attributes are missing, this returns false.
# 
#     :param object: an object that may or may not contain the listed attributes
#     :param names: a variable amount of attribute names to check for
#     :return: True if the object contains each named attribute, false otherwise
#     """
#     for name in names:
#         if not hasattr(object, name):
#             return False
#     return True


from anchorhub.util.hasattrs import hasattrs
"""
Tests for hasattrs.py

hasattrs.py:
http://www.github.com/samjabrahams/anchorhub/util/hasattrs.py
"""


class AttrObj(object):
    """
    Basic class with dummy attributes used to test hasattrs()
    """
    def __init__(self):
        self.a = 'a'
        self.b = 'b'
        self.c = 'c'

    def d(self):
        pass


def test_hasattrs_basic():
    """
    hasattrs.py: Basic usage
    """
    a = AttrObj()

# Path: anchorhub/util/hasattrs.py
# def hasattrs(object, *names):
#     """
#     Takes in an object and a variable length amount of named attributes,
#     and checks to see if the object has each property. If any of the
#     attributes are missing, this returns false.
# 
#     :param object: an object that may or may not contain the listed attributes
#     :param names: a variable amount of attribute names to check for
#     :return: True if the object contains each named attribute, false otherwise
#     """
#     for name in names:
#         if not hasattr(object, name):
#             return False
#     return True


# Path: anchorhub/util/tests/test_hasattrs.py
from anchorhub.util.hasattrs import hasattrs

"""
Tests for hasattrs.py

hasattrs.py:
http://www.github.com/samjabrahams/anchorhub/util/hasattrs.py
"""


class AttrObj(object):
    """
    Basic class with dummy attributes used to test hasattrs()
    """
    def __init__(self):
        self.a = 'a'
        self.b = 'b'
        self.c = 'c'

    def d(self):
        pass


def test_hasattrs_basic():
    """
    hasattrs.py: Basic usage
    """
    a = AttrObj()

    assert hasattrs(a, 'a', 'b', 'c')