class_docstr: Test class for CLIConfig
class_docstr_tok: ["Test","class","for","CLIConfig"]
docstr: CLI - Add Threat Intel Downloader config
docstr_tok: ["CLI","-","Add","Threat","Intel","Downloader","config"]
code: def test_add_threat_intel_downloader(self, write_mock, log_mock):
      """CLI - Add Threat Intel Downloader config"""
      del self.config["lambda"]["threat_intel_downloader_config"]
      ti_downloader_info = {
          "autoscale": True,
          "command": "threat_intel_downloader",
          "debug": False,
          "interval": "rate(1 day)",
          "memory": "128",
          "subcommand": "enable",
          "timeout": "240",
          "table_wcu": 25,
          "max_read_capacity": 100,
          "min_read_capacity": 5,
          "target_utilization": 70,
      }
      result = self.config.add_threat_intel_downloader(
          ti_downloader_info
      )
      assert_true(result)
      expected_config = {
          "autoscale": True,
          "enabled": True,
          "interval": "rate(1 day)",
          "ioc_filters": [],
          "ioc_keys": [],
          "ioc_types": [],
          "excluded_sub_types": [],
          "log_level": "info",
          "memory": "128",
          "table_rcu": 10,
          "table_wcu": 25,
          "timeout": "240",
          "max_read_capacity": 100,
          "min_read_capacity": 5,
          "target_utilization": 70,
      }
      assert_equal(
          self.config["lambda"]["threat_intel_downloader_config"],
          expected_config,
      )
      write_mock.assert_called()
      log_mock.assert_not_called()
  
      # no config changed if threat intel downloader already been enabled via CLI
      result = self.config.add_threat_intel_downloader(
          ti_downloader_info
      )
      assert_false(result)
      write_mock.assert_called_once()
      log_mock.assert_called_with(
          "Threat Intel Downloader has been enabled. "
          "Please edit config/lambda.json if you want to "
          "change lambda function settings."
      )
  
file_path: streamalert/tests/unit/streamalert_cli/test_cli_config.py
imports: import json
  from mock import patch, Mock
  from nose.tools import assert_equal, assert_true, assert_false
  from pyfakefs import fake_filesystem_unittest
  from streamalert_cli.config import CLIConfig
  from tests.unit.helpers.config import basic_streamalert_config
label_desc: Use image node_id 13 for calling the TestCLIConfig obj's underlying member method code with example usage: obj.test_add_threat_intel_downloader(write_mock, log_mock) without return types