# Path: core/utils/network_utils.py
# def get_free_port():
#     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#     s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#     s.bind(('', 0))
#     port = s.getsockname()[1]
#     s.close()
#     return port
# 
# Path: tests/helpers.py
# class TimeoutException(Exception):
#     class Response(object):
# class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
# class ServerMock(object):
# class BaseTestCase(unittest.TestCase):
# class DatabaseMock(Mock):
# def call_in_thread_mock(f):
#     def wrapper(*args, **kwargs):
# def wait_for(condition, timeout=10):
# def request(host, method, url, headers=None, body=None):
# def request_with_drop(address, desired_caps, method=None):
# def new_session_request(client, desired_caps):
# def open_url_request(client, session, data):
# def delete_session_request(client, session):
# def get_session_request(client, session):
# def run_script(client, session, script):
# def vmmaster_label(client, session, label=None):
# def server_is_up(address, wait=5):
# def server_is_down(address, wait=5):
# def fake_home_dir():
# def get_free_port():
#     def body(self):
#     def send_reply(self, code, headers, body):
#     def do_POST(self):
#     def do_GET(self):
#     def log_error(self, format, *args):
#     def log_message(self, format, *args):
#     def log_request(self, code='-', size='-'):
#     def __init__(self, host, port):
#     def start(self):
#     def stop(self):
#     def shortDescription(self):
# def set_primary_key(_self):
#     def __init__(self, *args, **kwargs):
#     def get_active_sessions(self, provider_id=None):
#     def get_session(self, session_id):
#     def get_endpoint(self, endpoint):
#     def get_endpoints(self, *args, **kwargs):
#     def get_last_session_step(session_id):
#     def register_provider(self, name, url, platforms):
# def custom_wait(self):
# def vmmaster_server_mock(port):
# def request_mock(**kwargs):
# def wait_deferred(d, timeout=5):


import unittest
import subprocess
from StringIO import StringIO
from multiprocessing.pool import ThreadPool
from os import setsid, killpg
from signal import SIGTERM
from lode_runner import dataprovider
from core.utils.network_utils import get_free_port
from tests.helpers import get_microapp_address
from tests.config import Config
        from tests.test_normal import TestPositiveCase
        from tests.test_normal import TestLongRequest
        from tests.test_normal import TestParallelSessions1, TestParallelSessions2
        from tests.test_normal import TestRunScriptOnSessionCreation
        from tests.test_normal import TestEnvironmentVariables
        from tests.test_normal import TestRunScriptWithInstallPackageOnSessionCreation
        from tests.test_normal import TestParallelSlowRunScriptOnSession1, TestParallelSlowRunScriptOnSession2
        from tests.test_normal import TestAndroidWebTestCase
        from tests.test_normal import TestAndroidNativeTestCase
# coding: utf-8




class TestCaseApp(unittest.TestCase):
    @classmethod
    def setUpClass(cls):

# Path: core/utils/network_utils.py
# def get_free_port():
#     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#     s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
#     s.bind(('', 0))
#     port = s.getsockname()[1]
#     s.close()
#     return port
# 
# Path: tests/helpers.py
# class TimeoutException(Exception):
#     class Response(object):
# class Handler(BaseHTTPServer.BaseHTTPRequestHandler):
# class ServerMock(object):
# class BaseTestCase(unittest.TestCase):
# class DatabaseMock(Mock):
# def call_in_thread_mock(f):
#     def wrapper(*args, **kwargs):
# def wait_for(condition, timeout=10):
# def request(host, method, url, headers=None, body=None):
# def request_with_drop(address, desired_caps, method=None):
# def new_session_request(client, desired_caps):
# def open_url_request(client, session, data):
# def delete_session_request(client, session):
# def get_session_request(client, session):
# def run_script(client, session, script):
# def vmmaster_label(client, session, label=None):
# def server_is_up(address, wait=5):
# def server_is_down(address, wait=5):
# def fake_home_dir():
# def get_free_port():
#     def body(self):
#     def send_reply(self, code, headers, body):
#     def do_POST(self):
#     def do_GET(self):
#     def log_error(self, format, *args):
#     def log_message(self, format, *args):
#     def log_request(self, code='-', size='-'):
#     def __init__(self, host, port):
#     def start(self):
#     def stop(self):
#     def shortDescription(self):
# def set_primary_key(_self):
#     def __init__(self, *args, **kwargs):
#     def get_active_sessions(self, provider_id=None):
#     def get_session(self, session_id):
#     def get_endpoint(self, endpoint):
#     def get_endpoints(self, *args, **kwargs):
#     def get_last_session_step(session_id):
#     def register_provider(self, name, url, platforms):
# def custom_wait(self):
# def vmmaster_server_mock(port):
# def request_mock(**kwargs):
# def wait_deferred(d, timeout=5):


# Path: tests/functional/functional_tests.py
import unittest
import subprocess
from StringIO import StringIO
from multiprocessing.pool import ThreadPool
from os import setsid, killpg
from signal import SIGTERM
from lode_runner import dataprovider
from core.utils.network_utils import get_free_port
from tests.helpers import get_microapp_address
from tests.config import Config
        from tests.test_normal import TestPositiveCase
        from tests.test_normal import TestLongRequest
        from tests.test_normal import TestParallelSessions1, TestParallelSessions2
        from tests.test_normal import TestRunScriptOnSessionCreation
        from tests.test_normal import TestEnvironmentVariables
        from tests.test_normal import TestRunScriptWithInstallPackageOnSessionCreation
        from tests.test_normal import TestParallelSlowRunScriptOnSession1, TestParallelSlowRunScriptOnSession2
        from tests.test_normal import TestAndroidWebTestCase
        from tests.test_normal import TestAndroidNativeTestCase

# coding: utf-8




class TestCaseApp(unittest.TestCase):
    @classmethod
    def setUpClass(cls):

        cls.app_port = get_free_port()