# Path: infi/pyutils/misc.py
# class Reprify(object):
#     def __init__(self, original, str=None, repr=None):
#         super(Reprify, self).__init__()
#         self._strify__original = original
#         if repr is None:
#             repr = str
#         if str is None:
#             str = repr
#         self._strify__str = str
#         self._strify__repr = repr
#     def __getattribute__(self, attr):
#         if attr.startswith('_strify__'):
#             return super(Reprify, self).__getattribute__(attr)
#         return getattr(self._strify__original, attr)
#     def __repr__(self):
#         if self._strify__repr is not None:
#             return self._strify__repr
#         return repr(self._strify__original)
#     def __str__(self):
#         if self._strify__str is not None:
#             return self._strify__str
#         return str(self._strify__originalx)


from .test_utils import TestCase
from infi.pyutils import Reprify

class OriginalObject(object):
    def __init__(self):
        super(OriginalObject, self).__init__()
        self.public_attr = 54321
        self._private_attr = 12345
    def method(self):
        return 666
    @classmethod
    def classmethod(cls):
        return 777
    @staticmethod
    def staticmethod():
        return 888
    def __repr__(self):
        raise NotImplementedError() # pragma: no cover
    def __str__(self):
        raise NotImplementedError() # pragma: no cover

class ReprifyTest(TestCase):
    def setUp(self):
        super(ReprifyTest, self).setUp()
        self.original_object = OriginalObject()
        self.REPR = "some repr here"
        self.STR  = "some str here"

# Path: infi/pyutils/misc.py
# class Reprify(object):
#     def __init__(self, original, str=None, repr=None):
#         super(Reprify, self).__init__()
#         self._strify__original = original
#         if repr is None:
#             repr = str
#         if str is None:
#             str = repr
#         self._strify__str = str
#         self._strify__repr = repr
#     def __getattribute__(self, attr):
#         if attr.startswith('_strify__'):
#             return super(Reprify, self).__getattribute__(attr)
#         return getattr(self._strify__original, attr)
#     def __repr__(self):
#         if self._strify__repr is not None:
#             return self._strify__repr
#         return repr(self._strify__original)
#     def __str__(self):
#         if self._strify__str is not None:
#             return self._strify__str
#         return str(self._strify__originalx)


# Path: tests/test__reprify.py
from .test_utils import TestCase
from infi.pyutils import Reprify


class OriginalObject(object):
    def __init__(self):
        super(OriginalObject, self).__init__()
        self.public_attr = 54321
        self._private_attr = 12345
    def method(self):
        return 666
    @classmethod
    def classmethod(cls):
        return 777
    @staticmethod
    def staticmethod():
        return 888
    def __repr__(self):
        raise NotImplementedError() # pragma: no cover
    def __str__(self):
        raise NotImplementedError() # pragma: no cover

class ReprifyTest(TestCase):
    def setUp(self):
        super(ReprifyTest, self).setUp()
        self.original_object = OriginalObject()
        self.REPR = "some repr here"
        self.STR  = "some str here"

        self.obj = Reprify(self.original_object, str=self.STR, repr=self.REPR)