# 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
            console_logging=False,
            collector_slug=None
        )
        try:
            main.main()
            assert not mock_get_config.called
        except:
            pass

    @mock.patch('performanceplatform.collector.main._run_collector')
    @mock.patch(
        'performanceplatform.client.collector.CollectorAPI.get_collector')
    @mock.patch('performanceplatform.utils.collector.get_config')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    def test_get_config_called_if_collector_in_args(self,
                                                    mock_parse_args,
                                                    mock_get_config,
                                                    mock_get_collector,
                                                    mock_run_collector):
        mock_parse_args.return_value = Namespace(
            collector_slug="some-collector",
            performanceplatform={
                'backdrop_url': 'http://foo/data',
                'stagecraft_url': 'http://foo.config.uk',
                'omniscient_api_token': 'fake-access-token'
            },
            console_logging=False,
            query=None
        )
        try:

# 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

            console_logging=False,
            collector_slug=None
        )
        try:
            main.main()
            assert not mock_get_config.called
        except:
            pass

    @mock.patch('performanceplatform.collector.main._run_collector')
    @mock.patch(
        'performanceplatform.client.collector.CollectorAPI.get_collector')
    @mock.patch('performanceplatform.utils.collector.get_config')
    @mock.patch('performanceplatform.collector.arguments.parse_args')
    def test_get_config_called_if_collector_in_args(self,
                                                    mock_parse_args,
                                                    mock_get_config,
                                                    mock_get_collector,
                                                    mock_run_collector):
        mock_parse_args.return_value = Namespace(
            collector_slug="some-collector",
            performanceplatform={
                'backdrop_url': 'http://foo/data',
                'stagecraft_url': 'http://foo.config.uk',
                'omniscient_api_token': 'fake-access-token'
            },
            console_logging=False,
            query=None
        )
        try:

            main.main()