<s> import unittest <EOL> from urllib3 . poolmanager import ProxyManager <EOL> class TestProxyManager ( unittest . TestCase ) : <EOL> def test_proxy_headers ( self ) : <EOL> p = ProxyManager ( '<STR_LIT>' ) <EOL> url = '<STR_LIT>' <EOL> default_headers = { '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> headers = p . _set_proxy_headers ( url ) <EOL> self . assertEqual ( headers , default_headers ) <EOL> provided_headers = { '<STR_LIT>' : '<STR_LIT:application/json>' , <EOL> '<STR_LIT>' : '<STR_LIT>' , <EOL> '<STR_LIT>' : '<STR_LIT>' } <EOL> headers = p . _set_proxy_headers ( url , provided_headers ) <EOL> self . assertEqual ( headers , provided_headers ) <EOL> provided_headers = { '<STR_LIT>' : '<STR_LIT:application/json>' } <EOL> expected_headers = provided_headers . copy ( ) <EOL> expected_headers . update ( { '<STR_LIT>' : '<STR_LIT>' } ) <EOL> url_with_port = '<STR_LIT>' <EOL> headers = p . _set_proxy_headers ( url_with_port , provided_headers ) <EOL> self . assertEqual ( headers , expected_headers ) <EOL> def test_default_port ( self ) : <EOL> p = ProxyManager ( '<STR_LIT>' ) <EOL> self . assertEqual ( p . proxy . port , <NUM_LIT> ) <EOL> p = ProxyManager ( '<STR_LIT>' ) <EOL> self . assertEqual ( p . proxy . port , <NUM_LIT> ) <EOL> def test_invalid_scheme ( self ) : <EOL> self . assertRaises ( AssertionError , ProxyManager , '<STR_LIT>' ) <EOL> self . assertRaises ( ValueError , ProxyManager , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
