class_docstr: TestRule class
class_docstr_tok: ["TestRule","class"]
docstr: Rule - Process, With Context
docstr_tok: ["Rule","-","Process",",","With","Context"]
code: def test_rule_process_with_context(self):
      """Rule - Process, With Context"""
  
      def test_rule(rec, context):  # pylint: disable=missing-docstring
          context["relevant"] = "data"
          # Update the context with the entire record so we can check for validity
          context.update(rec)
          return True
  
      test_rule = rule.Rule(test_rule, logs=["bar"], context={})
  
      # Test with data that should be placed into the context and overwritten
      # in subsequent calls
      test_rule.process({"foo": "bar"})
      assert_equal(
          test_rule.context, {"foo": "bar", "relevant": "data"}
      )
  
      # Test with new data that should get placed into the context
      # The previous data should no longer be present
      test_rule.process({"bar": "foo"})
      assert_equal(
          test_rule.context, {"bar": "foo", "relevant": "data"}
      )
  
imports: import hashlib
  from mock import patch
  from nose.tools import assert_equal, assert_true, raises
  from streamalert.shared import rule, rule_table
label_desc: Use image node_id 14 for calling the TestRule obj's underlying member method code with example usage: obj.test_rule_process_with_context() and returns: True