Пример #1
0
import responses
from mock import MagicMock
from syncloud.app import logger
from syncloud.insider.dns import Dns
from syncloud.insider.port_mapper import PortMapper
from convertible import reformat

from syncloud.insider.config import Port, Domain, Service
from helpers import get_port_config, get_domain_config, get_service_config, get_insider_config

from syncloud.tools import config
from syncloud.tools import footprint
from syncloud.tools import id

logger.init(level=logging.DEBUG, console=True)


def get_upnpc(external_ip):
    upnpc = MagicMock()
    upnpc.external_ip = MagicMock(return_value=external_ip)
    upnpc.port_open_on_router = MagicMock(return_value=False)
    return upnpc


def get_port_mapper(port_config, upnpc):
    return PortMapper(port_config, upnpc)


class TestDns(unittest.TestCase):
Пример #2
0
def manager():
    logger.init(logging.DEBUG, console=True)
    if manager_mock:
        return manager_mock
    else:
        return Manager(config)