<commit_before>import unittest
import types

import cedexis.radar.cli

class TestCommandLineInterface(unittest.TestCase):

    def test_main(self):
        self.assertTrue(isinstance(cedexis.radar.cli.main, types.FunctionType))<commit_msg>Add unit test for overrides<commit_after>import unittest
from unittest.mock import patch, MagicMock, call
import types
from pprint import pprint

import cedexis.radar.cli

class TestCommandLineInterface(unittest.TestCase):

    def test_main(self):
        self.assertTrue(isinstance(cedexis.radar.cli.main, types.FunctionType))

    @patch('logging.getLogger')
    @patch('argparse.ArgumentParser')
    @patch('cedexis.radar.run_session')
    @patch('time.sleep')
    def test_config_file_with_cli_params(self, mock_sleep, mock_run_session,
        mock_ArgumentParser, mock_getLogger):
        args = make_default_args()
        args.continuous = True
        args.max_runs = 3
        args.repeat_delay = 60
        mock_parser = MagicMock()
        mock_parser.parse_args.return_value = args
        mock_ArgumentParser.return_value = mock_parser
        cedexis.radar.cli.main()

        # Assert
        # print(mock_run_session.call_args)
        self.assertEqual(
            mock_run_session.call_args_list,
            [
                call(1, 12345, 'sandbox', False, None, None, False, None),
                call(1, 12345, 'sandbox', False, None, None, False, None),
                call(1, 12345, 'sandbox', False, None, None, False, None)
            ])
        # print(mock_sleep.call_args)
        self.assertEqual(mock_sleep.call_args_list, [call(60),call(60)])

def make_default_args():
    args = lambda: None
    args.zone_id = 1
    args.customer_id = 12345
    args.api_key = 'sandbox'
    args.secure = False
    args.config_file = 'some config file path'
    args.tracer = None
    args.provider_id = None
    args.report_server = None
    args.max_runs = None
    args.repeat_delay = None
    return args
{'fraction_non_alphanumeric': 0.09796954314720813, 'fraction_numerical': 0.015736040609137057, 'mean_word_length': 3.022448979591837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3843846', 'n_tokens_mistral': 649, 'n_tokens_neox': 615, 'n_words': 123}