# Path: botnet/wrappers.py
# class ModuleWrapper(object):
#     """Wraps a module. It is used to hold a reference to a loaded module in the
#     Manager.
#     """
# 
#     def __init__(self, module):
#         self.module = module
#         self.name = get_ident_string(module.__class__)
#         self.logger = get_logger(str(self))
# 
#     def __repr__(self):
#         return '%s: %s' % (self.__class__.__name__, self.module)
# 
#     def start(self):
#         self.logger.debug('Start')
#         self.module.start()
# 
#     def stop(self):
#         self.logger.debug('Stop')
#         self.module.stop()


from botnet.wrappers import ModuleWrapper


class ModuleMock():

    def __init__(self, *args, **kwargs):
        self.started = False
        self.stopped = False

    def start(self):
        self.started = True

    def stop(self):
        self.stopped = True


def test_wrapper_start():
    m = ModuleMock()
    w = ModuleWrapper(m)
    w.start()
    assert m.started


def test_wrapper_stop():
    m = ModuleMock()

# Path: botnet/wrappers.py
# class ModuleWrapper(object):
#     """Wraps a module. It is used to hold a reference to a loaded module in the
#     Manager.
#     """
# 
#     def __init__(self, module):
#         self.module = module
#         self.name = get_ident_string(module.__class__)
#         self.logger = get_logger(str(self))
# 
#     def __repr__(self):
#         return '%s: %s' % (self.__class__.__name__, self.module)
# 
#     def start(self):
#         self.logger.debug('Start')
#         self.module.start()
# 
#     def stop(self):
#         self.logger.debug('Stop')
#         self.module.stop()


# Path: tests/test_wrapper.py
from botnet.wrappers import ModuleWrapper



class ModuleMock():

    def __init__(self, *args, **kwargs):
        self.started = False
        self.stopped = False

    def start(self):
        self.started = True

    def stop(self):
        self.stopped = True


def test_wrapper_start():
    m = ModuleMock()
    w = ModuleWrapper(m)
    w.start()
    assert m.started


def test_wrapper_stop():
    m = ModuleMock()

    w = ModuleWrapper(m)