def assertHeadersEqual(self, expected, actual, msg=None):
    """Tests whether two sets of HTTP headers are equivalent.

    The header sets expected and actual are equal if they both have exactly the
    same set of header name/value pairs. Header names are considered
    case-insensitive, but header values are case sensitive. The order does not
    matter, but duplicate headers (headers of the same name) must be the same in
    both.

    Note: This should be used instead of assertEqual, assertItemsEqual or
    assertDictEqual. Using standard asserts for lists and dicts will be case
    sensitive. Using assert for wsgiref.headers.Headers does reference equality.

    Args:
      expected: A sequence of pairs, a dict or a wsgiref.headers.Headers object.
      actual: A sequence of pairs, a dict or a wsgiref.headers.Headers object.
      msg: A custom error message to display, if the test fails.

    Raises:
      AssertionError if expected and actual are not equal.
    """
    expected = self._normalize_headers(expected)
    actual = self._normalize_headers(actual)

    for name, value in actual:
      self.assertIsInstance(name, str, 'header name %r must be a str' % name)
      self.assertIsInstance(name, str, 'header value %r must be a str' % value)
    self.assertItemsEqual(expected, actual, msg)
dataset/ETHPy150Open AppScale/appscale/AppServer/google/appengine/tools/devappserver2/wsgi_test_utils.py/WSGITestCase.assertHeadersEqual/original