class_docstr: Tests for shared/rule_table.py
docstr: Rule Table - Update
docstr_tok: ["Rule","Table","-","Update"]
code: def test_update(self):
      """Rule Table - Update"""
      rule_name = "init_rule"
      self._create_db_rule_with_name(rule_name)
      assert_equal(self.rule_table._table.item_count, 1)
      self._create_local_rule_with_name("test_rule_01")
      self._create_local_rule_with_name("test_rule_02")
  
      # Run the update to ensure the old rule was deleted and the new rules are added
      self.rule_table.update()
      assert_equal(len(self.rule_table._load_remote_state()), 2)
      item = self.rule_table._table.get_item(
          Key={"RuleName": rule_name}
      )
      assert_equal(item.get("Item"), None)
      item = self.rule_table._table.get_item(
          Key={"RuleName": "test_rule_02"}
      )
      assert_equal(item["Item"]["RuleName"], "test_rule_02")
  
imports: from datetime import datetime
  import os
  from io import StringIO
  from botocore.exceptions import ClientError
  from mock import Mock, patch
  from moto import mock_dynamodb2
  from nose.tools import assert_equal, assert_not_equal, assert_raises
  from streamalert.shared import rule, rule_table
  from tests.unit.helpers.aws_mocks import setup_mock_rules_table
label_desc: Use image node_id 20 for calling the TestRuleTable obj's underlying member method code with example usage: obj.test_update() without return types