else:
        self.assertIn(key, result)


 # handling Assertionerror as TestApp throws
 # AssertionError: Content-Type header found in a 204 response,
 # which must not return content.
  def testPostTSection(self):
    try:
      self.app.post("/aws", json.dumps(
        {"aws_access_key_id" : "dummy_value_aws_key"}), headers=self.headers)
    except AssertionError, ae:
      print ae.message
    finally:
      config = GrokAppConfig()
      self.assertEqual(config.get("aws", "aws_access_key_id"),
        "dummy_value_aws_key")


 # handling Assertionerror as TestApp throws
 # AssertionError: Content-Type header found in a 204 response,
 # which must not return content.
  def testPostAll(self):
    try:
      self.app.post("/", json.dumps(
        { "aws" : {"aws_secret_access_key" : "dummy_value_aws_secret",
          "aws_access_key_id" : "dummy_value_aws_key_id"}
         }), headers=self.headers)
    except AssertionError, ae:
      print ae.message
    finally:
    Test for POST for '/_settings', Set some setting
    resoponse is validated for appropriate headers and body
    """
        # IMPORTANT: functions are executed in reverse order from when they are
        # added so we need to add config.save first.
        configBackup = GrokAppConfig(mode=GrokAppConfig.MODE_OVERRIDE_ONLY)
        self.addCleanup(configBackup.save)
        del configBackup

        try:
            self.app.post("/aws", app_utils.jsonEncode({"aws_access_key_id": "dummy_aws_key1"}), headers=self.headers)
        except AssertionError, ae:
            print ae.message
        finally:
            config = GrokAppConfig()
            self.assertEqual(config.get("aws", "aws_access_key_id"), "dummy_aws_key1")

    def testPOSTSectionInvalid(self):
        """
    Test for POST for '/_settings', Set some invalid setting
    resoponse is validated for appropriate headers and body
    """
        with self.assertRaises(AppError) as e:
            self.app.post("/foo", app_utils.jsonEncode({"aws_access_key_id": "dummy_aws_key2"}), headers=self.headers)
        self.assertIn(
            "Bad response: 400 Bad Request (not 200 OK or 3xx redirect"
            " for /foo)\nFailed to update configuration settings",
            str(e.exception),
        )

    # handling Assertionerror as TestApp throws
    resoponse is validated for appropriate headers and body
    """
    # IMPORTANT: functions are executed in reverse order from when they are
    # added so we need to add config.save first.
    configBackup = GrokAppConfig(mode=GrokAppConfig.MODE_OVERRIDE_ONLY)
    self.addCleanup(configBackup.save)
    del configBackup

    try:
      self.app.post("/aws", app_utils.jsonEncode(
        {"aws_access_key_id" : "dummy_aws_key1"}), headers=self.headers)
    except AssertionError, ae:
      print ae.message
    finally:
      config = GrokAppConfig()
      self.assertEqual(config.get("aws", "aws_access_key_id"),
                       "dummy_aws_key1")


  def testPOSTSectionInvalid(self):
    """
    Test for POST for '/_settings', Set some invalid setting
    resoponse is validated for appropriate headers and body
    """
    with self.assertRaises(AppError) as e:
      self.app.post("/foo", app_utils.jsonEncode(
        {"aws_access_key_id" : "dummy_aws_key2"}), headers=self.headers)
    self.assertIn("Bad response: 400 Bad Request (not 200 OK or 3xx redirect"
    " for /foo)\nFailed to update configuration settings", str(e.exception))