# Path: pycell/assert_implements.py
# def assert_implements(obj, interface):
#     if interface == object:
#         return
#     elif hasattr(interface, "implements"):
#         if not interface.implements(obj):
#             raise AssertionError(
#                 "Object "
#                 + str(obj)
#                 + " does not implement interface "
#                 + interface.__name__
#                 + "."
#             )
#     else:
#         required = set(interface.required_members())
#         existing = set(obj.__class__.__dict__.keys())
#         missing = required - existing
#         if len(missing) > 0:
#             raise AssertionError(
#                 "Object "
#                 + str(obj)
#                 + " does not implement interface "
#                 + interface.__name__
#                 + ".  Missing members: "
#                 + str(missing)
#             )
# 
# Path: tests/util/matcher.py
# class Matcher:
# 
#     @staticmethod
#     def required_members():
#         return ["matches", "description"]


from pycell.assert_implements import assert_implements
from tests.util.matcher import Matcher


# Inspired by Hamcrest


def assert_that(obj, matcher):
    assert_implements(obj, object)
    assert_implements(matcher, Matcher)
    if not matcher.matches(obj):
        raise AssertionError(matcher.description())


def assert_fails(error, fn, *args):

# Path: pycell/assert_implements.py
# def assert_implements(obj, interface):
#     if interface == object:
#         return
#     elif hasattr(interface, "implements"):
#         if not interface.implements(obj):
#             raise AssertionError(
#                 "Object "
#                 + str(obj)
#                 + " does not implement interface "
#                 + interface.__name__
#                 + "."
#             )
#     else:
#         required = set(interface.required_members())
#         existing = set(obj.__class__.__dict__.keys())
#         missing = required - existing
#         if len(missing) > 0:
#             raise AssertionError(
#                 "Object "
#                 + str(obj)
#                 + " does not implement interface "
#                 + interface.__name__
#                 + ".  Missing members: "
#                 + str(missing)
#             )
# 
# Path: tests/util/matcher.py
# class Matcher:
# 
#     @staticmethod
#     def required_members():
#         return ["matches", "description"]


# Path: tests/util/asserts.py
from pycell.assert_implements import assert_implements
from tests.util.matcher import Matcher



# Inspired by Hamcrest


def assert_that(obj, matcher):
    assert_implements(obj, object)
    assert_implements(matcher, Matcher)
    if not matcher.matches(obj):
        raise AssertionError(matcher.description())


def assert_fails(error, fn, *args):

    try: