# Path: performanceplatform/collector/main.py
# def main():
#     args = arguments.parse_args('Performance Platform Collector')
#     if args.collector_slug:
#         args.query = get_config(args.collector_slug, args.performanceplatform)
# 
#     _run_collector(args.query['entrypoint'], args)


from argparse import Namespace
from hamcrest import assert_that, equal_to
from performanceplatform.collector import main
import mock
import os
import unittest
                '_log_collector_instead_of_running')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    @mock.patch('performanceplatform.utils.collector.get_config')
    def test_collectors_can_be_disabled(self,
                                        mock_get_config,
                                        mock_parse_args,
                                        mock_log_collector_instead_of_running):
        orig_disable_collectors = os.getenv('DISABLE_COLLECTORS')
        mock_parse_args.return_value = Namespace(
            collector_slug=None,
            query={
                'entrypoint': 'foo.collector'
            },
            console_logging=True,
        )
        try:
            os.environ['DISABLE_COLLECTORS'] = 'true'
            main.main()
            assert mock_log_collector_instead_of_running.called
        finally:
            if orig_disable_collectors:
                os.environ['DISABLE_COLLECTORS'] = orig_disable_collectors
            else:
                os.unsetenv('DISABLE_COLLECTORS')

    @mock.patch('performanceplatform.collector.main._run_collector')
    @mock.patch('performanceplatform.utils.collector.get_config')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    def test_get_config_not_called_if_query_file_in_args(self,
                                                         mock_parse_args,

# Path: performanceplatform/collector/main.py
# def main():
#     args = arguments.parse_args('Performance Platform Collector')
#     if args.collector_slug:
#         args.query = get_config(args.collector_slug, args.performanceplatform)
# 
#     _run_collector(args.query['entrypoint'], args)


# Path: tests/performanceplatform/collector/test_main.py
from argparse import Namespace
from hamcrest import assert_that, equal_to
from performanceplatform.collector import main
import mock
import os
import unittest

                '_log_collector_instead_of_running')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    @mock.patch('performanceplatform.utils.collector.get_config')
    def test_collectors_can_be_disabled(self,
                                        mock_get_config,
                                        mock_parse_args,
                                        mock_log_collector_instead_of_running):
        orig_disable_collectors = os.getenv('DISABLE_COLLECTORS')
        mock_parse_args.return_value = Namespace(
            collector_slug=None,
            query={
                'entrypoint': 'foo.collector'
            },
            console_logging=True,
        )
        try:
            os.environ['DISABLE_COLLECTORS'] = 'true'
            main.main()
            assert mock_log_collector_instead_of_running.called
        finally:
            if orig_disable_collectors:
                os.environ['DISABLE_COLLECTORS'] = orig_disable_collectors
            else:
                os.unsetenv('DISABLE_COLLECTORS')

    @mock.patch('performanceplatform.collector.main._run_collector')
    @mock.patch('performanceplatform.utils.collector.get_config')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    def test_get_config_not_called_if_query_file_in_args(self,
                                                         mock_parse_args,

                                                         mock_get_config,