Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def assert_not_in_headers(self, member, msg=None):
if member in headers_as_text(self.py_response.headers):
msg = msg or "Header %s was found in response headers text" % member
raise AssertionError(msg)
return self
def assert_regex_not_in_headers(self, member, msg=None):
assert_not_regexp(member, headers_as_text(self.py_response.headers), msg=msg)
return self
def assert_in_headers(self, member, msg=None):
headers_text = headers_as_text(self.py_response.headers)
if member not in headers_text:
msg = msg or "Header %s wasn't found in response headers text: %r" % (member, headers_text)
raise AssertionError(msg)
return self
def assert_regex_in_headers(self, member, msg=None):
assert_regexp(member, headers_as_text(self.py_response.headers), msg=msg)
return self