class_docstr: Test class to test ThreatStream functionalities
class_docstr_tok: ["Test","class","to","test","ThreatStream","functionalities"]
docstr: ThreatStream - Write Intel to DynamoDB Table
docstr_tok: ["ThreatStream","-","Write","Intel","to","DynamoDB","Table"]
code: def test_write_to_dynamodb_table(self, boto_mock):
      """ThreatStream - Write Intel to DynamoDB Table"""
      intel = [
          self._get_fake_intel("malicious_domain.com", "test_source")
      ]
      expected_intel = {
          "expiration_ts": "2017-11-30T00:01:02.123Z",
          "source": "test_source",
          "ioc_type": "domain",
          "sub_type": "c2_domain",
          "ioc_value": "malicious_domain.com",
      }
      self.threatstream._write_to_dynamodb_table(intel)
      batch_writer = (
          boto_mock.return_value.Table.return_value.batch_writer.return_value
      )
      batch_writer.__enter__.return_value.put_item.assert_called_with(
          Item=expected_intel
      )
  
imports: from datetime import datetime
  import os
  import boto3
  from botocore.exceptions import ClientError
  from mock import Mock, patch
  from moto import mock_ssm
  from nose.tools import assert_equal, raises
  from streamalert.shared.config import load_config
  from streamalert.threat_intel_downloader.exceptions import ThreatStreamCredsError, ThreatStreamLambdaInvokeError, ThreatStreamRequestsError
  from streamalert.threat_intel_downloader.main import ThreatStream
  from tests.unit.streamalert.apps.test_helpers import MockLambdaClient
  from tests.unit.streamalert.shared.test_config import get_mock_lambda_context
  from tests.unit.streamalert.threat_intel_downloader.test_helpers import put_mock_params
label_desc: Use image node_id 28 for calling the TestThreatStream obj's underlying member method code with example usage: obj.test_write_to_dynamodb_table(boto_mock) without return types