<s> """<STR_LIT>""" <EOL> from . . base_test import FlaskCorsTestCase <EOL> from flask import Flask <EOL> from flask_cors import * <EOL> from flask_cors . core import * <EOL> class AllowHeadersTestCaseIntegration ( FlaskCorsTestCase ) : <EOL> def setUp ( self ) : <EOL> self . app = Flask ( __name__ ) <EOL> @ self . app . route ( '<STR_LIT>' ) <EOL> @ cross_origin ( ) <EOL> def test_default ( ) : <EOL> return '<STR_LIT>' <EOL> @ self . app . route ( '<STR_LIT>' ) <EOL> @ cross_origin ( allow_headers = [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> def test_allow_headers ( ) : <EOL> return '<STR_LIT>' <EOL> @ self . app . route ( '<STR_LIT>' ) <EOL> @ cross_origin ( allow_headers = [ r'<STR_LIT>' ] ) <EOL> def test_allow_headers_regex ( ) : <EOL> return '<STR_LIT>' <EOL> def test_default ( self ) : <EOL> for resp in self . iter_responses ( '<STR_LIT>' ) : <EOL> self . assertTrue ( resp . headers . get ( ACL_ALLOW_HEADERS ) is None , <EOL> "<STR_LIT>" ) <EOL> def test_allow_headers_no_request_headers ( self ) : <EOL> '''<STR_LIT>''' <EOL> resp = self . preflight ( '<STR_LIT>' , origin = '<STR_LIT>' ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , None ) <EOL> def test_allow_headers_with_request_headers ( self ) : <EOL> '''<STR_LIT>''' <EOL> resp = self . preflight ( '<STR_LIT>' , <EOL> origin = '<STR_LIT>' , <EOL> cors_request_headers = [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , <EOL> '<STR_LIT>' ) <EOL> def test_allow_headers_with_unmatched_request_headers ( self ) : <EOL> '''<STR_LIT>''' <EOL> resp = self . preflight ( '<STR_LIT>' , <EOL> origin = '<STR_LIT>' , <EOL> cors_request_headers = [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , None ) <EOL> resp = self . preflight ( '<STR_LIT>' , <EOL> origin = '<STR_LIT>' , <EOL> cors_request_headers = [ '<STR_LIT>' , <EOL> '<STR_LIT>' ] ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , <EOL> '<STR_LIT>' ) <EOL> def test_allow_headers_regex ( self ) : <EOL> '''<STR_LIT>''' <EOL> resp = self . preflight ( '<STR_LIT>' , <EOL> origin = '<STR_LIT>' , <EOL> cors_request_headers = [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , '<STR_LIT>' ) <EOL> resp = self . preflight ( '<STR_LIT>' , <EOL> origin = '<STR_LIT>' , <EOL> cors_request_headers = [ '<STR_LIT>' ] ) <EOL> self . assertEqual ( resp . headers . get ( ACL_ALLOW_HEADERS ) , None ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> unittest . main ( ) </s>
