class_docstr: Normalizer tests
class_docstr_tok: ["Normalizer","tests"]
docstr: Normalizer - Test match condition with different conditions
docstr_tok: ["Normalizer","-","Test","match","condition","with","different","conditions"]
code: def test_match_condition(self):
      """Normalizer - Test match condition with different conditions"""
      record = self._test_record()
  
      condition = {"path": ["account"], "is": "123456"}
      assert_true(Normalizer._match_condition(record, condition))
  
      condition = {"path": ["account"], "is_not": "123456"}
      assert_false(Normalizer._match_condition(record, condition))
  
      condition = {
          "path": ["detail", "awsRegion"],
          "contains": "region",
      }
      assert_true(Normalizer._match_condition(record, condition))
  
      condition = {
          "path": ["detail", "awsRegion"],
          "contains": "not_region",
      }
      assert_false(Normalizer._match_condition(record, condition))
  
      condition = {
          "path": ["detail", "userIdentity", "userName"],
          "not_contains": "alice",
      }
      assert_false(Normalizer._match_condition(record, condition))
  
      condition = {
          "path": ["sourceIPAddress"],
          "in": ["1.1.1.2", "1.1.1.3"],
      }
      assert_true(Normalizer._match_condition(record, condition))
  
      condition = {
          "path": ["sourceIPAddress"],
          "not_in": ["1.1.1.2", "1.1.1.3"],
      }
      assert_false(Normalizer._match_condition(record, condition))
  
      # Only support extract one condition. The result is not quaranteed if multiple conditions
      # configured. In this test case, it is because 'not_in' condition is checked before
      # 'contains'
      condition = {
          "path": ["detail", "userIdentity", "invokedBy"],
          "contains": "amazonaws.com",
          "not_in": ["signin.amazonaws.com", "s3.amazonaws.com"],
      }
      assert_false(Normalizer._match_condition(record, condition))
  
imports: from mock import Mock, patch
  from nose.tools import assert_equal, assert_false, assert_raises, assert_true
  from streamalert.shared.exceptions import ConfigError
  from streamalert.shared.normalize import Normalizer, NormalizedType
  from tests.unit.streamalert.shared.test_utils import MOCK_RECORD_ID
label_desc: Use image node_id 24 for calling the TestNormalizer obj's underlying member method code with example usage: obj.test_match_condition() without return types