# Path: baobab/socialnetwork/base.py
# class SocialNetworkBase(object):
# 
#     """
#     interface for all social network, each social network have to
#     inherited from this class
#     """
# 
#     name = None
# 
#     @classmethod
#     def is_configured(cls):
#         raise NotImplementedError()
# 
#     @classmethod
#     def get_max_char(cls, default):
#         raise NotImplementedError()
# 
#     def publish(self, msg, url):
#         """
#         should raise if it failed
#         """
#         raise NotImplementedError()
# 
#     def  __enter__(self):
#         raise NotImplementedError()
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         raise NotImplementedError()


from baobab.socialnetwork.base import SocialNetworkBase


class MockSN(SocialNetworkBase):
    name = 'MockSN'

    def __init__(self):
        self._msg = []

    @classmethod
    def is_configured(cls):
        True

    @classmethod
    def get_max_char(cls, default):
        return 42

    def publish(self, msg, url):
        self._msg.append((msg, url))
        return len(self._msg)

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        pass


def mock_get_field_by_name():
    class Field(object):
        max_length = 42

# Path: baobab/socialnetwork/base.py
# class SocialNetworkBase(object):
# 
#     """
#     interface for all social network, each social network have to
#     inherited from this class
#     """
# 
#     name = None
# 
#     @classmethod
#     def is_configured(cls):
#         raise NotImplementedError()
# 
#     @classmethod
#     def get_max_char(cls, default):
#         raise NotImplementedError()
# 
#     def publish(self, msg, url):
#         """
#         should raise if it failed
#         """
#         raise NotImplementedError()
# 
#     def  __enter__(self):
#         raise NotImplementedError()
# 
#     def __exit__(self, exc_type, exc_val, exc_tb):
#         raise NotImplementedError()


# Path: baobab/utils/mock.py
from baobab.socialnetwork.base import SocialNetworkBase



class MockSN(SocialNetworkBase):
    name = 'MockSN'

    def __init__(self):
        self._msg = []

    @classmethod
    def is_configured(cls):
        True

    @classmethod
    def get_max_char(cls, default):
        return 42

    def publish(self, msg, url):
        self._msg.append((msg, url))
        return len(self._msg)

    def __enter__(self):
        return self

    def __exit__(self, exc_type, exc_val, exc_tb):
        pass


def mock_get_field_by_name():
    class Field(object):
        max_length = 42

    return (Field(), )