# Path: stackimpact/runtime.py
# class runtime_info(object):
#     OS_LINUX = (sys.platform.startswith('linux'))
#     OS_DARWIN = (sys.platform == 'darwin')
#     OS_WIN = (sys.platform == 'win32')
#     PYTHON_2 = (sys.version_info.major == 2)
#     PYTHON_3 = (sys.version_info.major == 3)
#     GEVENT = False
# 
# def min_version(major, minor=0):
#     return (sys.version_info.major == major and sys.version_info.minor >= minor)


import unittest
import sys
import threading
import random
import time
import stackimpact
from stackimpact.runtime import runtime_info, min_version
    def test_run_in_main_thread(self):
        if runtime_info.OS_WIN:
            return

        stackimpact._agent = None
        agent = stackimpact.start(
            dashboard_address = 'http://localhost:5001',
            agent_key = 'key1',
            app_name = 'TestPythonApp',
            debug = True
        )

        result = {}

        def _run():
            result['thread_id'] = threading.current_thread().ident

        def _thread():
            agent.run_in_main_thread(_run)

        t = threading.Thread(target=_thread)
        t.start()
        t.join()

        self.assertEqual(result['thread_id'], threading.current_thread().ident)

        agent.destroy()


    def test_profile(self):

# Path: stackimpact/runtime.py
# class runtime_info(object):
#     OS_LINUX = (sys.platform.startswith('linux'))
#     OS_DARWIN = (sys.platform == 'darwin')
#     OS_WIN = (sys.platform == 'win32')
#     PYTHON_2 = (sys.version_info.major == 2)
#     PYTHON_3 = (sys.version_info.major == 3)
#     GEVENT = False
# 
# def min_version(major, minor=0):
#     return (sys.version_info.major == major and sys.version_info.minor >= minor)


# Path: tests/agent_test.py
import unittest
import sys
import threading
import random
import time
import stackimpact
from stackimpact.runtime import runtime_info, min_version

    def test_run_in_main_thread(self):
        if runtime_info.OS_WIN:
            return

        stackimpact._agent = None
        agent = stackimpact.start(
            dashboard_address = 'http://localhost:5001',
            agent_key = 'key1',
            app_name = 'TestPythonApp',
            debug = True
        )

        result = {}

        def _run():
            result['thread_id'] = threading.current_thread().ident

        def _thread():
            agent.run_in_main_thread(_run)

        t = threading.Thread(target=_thread)
        t.start()
        t.join()

        self.assertEqual(result['thread_id'], threading.current_thread().ident)

        agent.destroy()


    def test_profile(self):

        if runtime_info.OS_WIN: