# 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

        stackimpact._agent = None
        agent = stackimpact.start(
            dashboard_address = 'http://localhost:5001',
            agent_key = 'key1',
            app_name = 'TestPythonApp',
            auto_profiling = False,
            debug = True
        )
        
        messages = []
        def add_mock(topic, message):
            messages.append(message)
        agent.message_queue.add = add_mock

        agent.start_allocation_profiler()

        mem1 = []
        for i in range(0, 1000):
            obj1 = {'v': random.randint(0, 1000000)}
            mem1.append(obj1)

        agent.stop_allocation_profiler()

        self.assertTrue('agent_test.py' in str(messages))

        agent.destroy()


    def test_block_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


        stackimpact._agent = None
        agent = stackimpact.start(
            dashboard_address = 'http://localhost:5001',
            agent_key = 'key1',
            app_name = 'TestPythonApp',
            auto_profiling = False,
            debug = True
        )
        
        messages = []
        def add_mock(topic, message):
            messages.append(message)
        agent.message_queue.add = add_mock

        agent.start_allocation_profiler()

        mem1 = []
        for i in range(0, 1000):
            obj1 = {'v': random.randint(0, 1000000)}
            mem1.append(obj1)

        agent.stop_allocation_profiler()

        self.assertTrue('agent_test.py' in str(messages))

        agent.destroy()


    def test_block_profile(self):

        if runtime_info.OS_WIN or not min_version(3, 4):