# Path: feedplatform/addins.py
# class base(object):
#     class __metaclass__(type):
#         def __new__(cls, name, bases, attrs):
#     def __new__(cls, *args, **kwargs):
#     def setup(self):
#     def log(self):
# def get_addins():
# def _make_addin(addin):
# def reinstall(addins=None):
#         def resolve_dependencies(addin, index):
# def install(*args, **kwargs):
# _ADDINS = None
#     _ADDINS = to_be_setup


from feedplatform import addins

"""


class image_hook_counter(addins.base):
    """Test helper addin that counts feed image events.
    """
    called = 0
    success = 0
    failure = 0
    def on_update_feed_image(self, feed, image_dict, image):
        self.called += 1
    def on_feed_image_updated(self, feed, image_dict, image):
        self.success += 1
    def on_feed_image_failed(self, feed, image_dict, image, e):
        self.failure += 1


class image_reader(addins.base):
    """Cause possible exceptions during image read() to occur.

    Since we don't want to involve any of the other, more functional
    addins at this point, this mock addin just accesses the image so that
    a potential ImageTooLarge exception may be raised.
    """
    def on_update_feed_image(self, feed, image_dict, image):
        image.data.read()


FeedWithImage = """
    <rss><channel>

# Path: feedplatform/addins.py
# class base(object):
#     class __metaclass__(type):
#         def __new__(cls, name, bases, attrs):
#     def __new__(cls, *args, **kwargs):
#     def setup(self):
#     def log(self):
# def get_addins():
# def _make_addin(addin):
# def reinstall(addins=None):
#         def resolve_dependencies(addin, index):
# def install(*args, **kwargs):
# _ADDINS = None
#     _ADDINS = to_be_setup


# Path: tests/lib/feeds/images/_image_test_utils.py
from feedplatform import addins

"""


class image_hook_counter(addins.base):
    """Test helper addin that counts feed image events.
    """
    called = 0
    success = 0
    failure = 0
    def on_update_feed_image(self, feed, image_dict, image):
        self.called += 1
    def on_feed_image_updated(self, feed, image_dict, image):
        self.success += 1
    def on_feed_image_failed(self, feed, image_dict, image, e):
        self.failure += 1


class image_reader(addins.base):
    """Cause possible exceptions during image read() to occur.

    Since we don't want to involve any of the other, more functional
    addins at this point, this mock addin just accesses the image so that
    a potential ImageTooLarge exception may be raised.
    """
    def on_update_feed_image(self, feed, image_dict, image):
        image.data.read()


FeedWithImage = """
    <rss><channel>

        <title>test-feed</title>
