<s> import unittest <EOL> from swift . common . header_key_dict import HeaderKeyDict <EOL> class TestHeaderKeyDict ( unittest . TestCase ) : <EOL> def test_case_insensitive ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:10> <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:20> <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_setdefault ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> ret = headers . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( ret , '<STR_LIT>' ) <EOL> ret = headers . setdefault ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> self . assertEqual ( ret , '<STR_LIT>' ) <EOL> headers . setdefault ( '<STR_LIT>' , None ) <EOL> def test_del_contains ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> self . assertTrue ( '<STR_LIT>' in headers ) <EOL> del headers [ '<STR_LIT>' ] <EOL> self . assertTrue ( '<STR_LIT>' not in headers ) <EOL> def test_update ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers . update ( { '<STR_LIT>' : '<STR_LIT:0>' } ) <EOL> headers . update ( [ ( '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ] ) <EOL> self . assertEqual ( headers [ '<STR_LIT>' ] , '<STR_LIT:0>' ) <EOL> self . assertEqual ( headers [ '<STR_LIT:Content-Type>' ] , '<STR_LIT>' ) <EOL> def test_get ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:20> <EOL> self . assertEqual ( headers . get ( '<STR_LIT>' ) , '<STR_LIT>' ) <EOL> self . assertEqual ( headers . get ( '<STR_LIT>' ) , None ) <EOL> self . assertEqual ( headers . get ( '<STR_LIT>' , True ) , True ) <EOL> def test_keys ( self ) : <EOL> headers = HeaderKeyDict ( ) <EOL> headers [ '<STR_LIT>' ] = <NUM_LIT:20> <EOL> headers [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> headers [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> self . assertEqual ( <EOL> set ( headers . keys ( ) ) , <EOL> set ( ( '<STR_LIT>' , '<STR_LIT:Content-Type>' , '<STR_LIT>' ) ) ) </s>
