<s> """<STR_LIT>""" <EOL> import sys <EOL> import unittest <EOL> from test import test_support <EOL> class DictproxyTestCase ( unittest . TestCase ) : <EOL> def test_dictproxy ( self ) : <EOL> proxy = type . __dict__ <EOL> first_key = iter ( proxy ) . next ( ) <EOL> self . assert_ ( isinstance ( first_key , str ) ) <EOL> self . assert_ ( first_key in proxy ) <EOL> self . assert_ ( proxy . has_key ( first_key ) ) <EOL> self . assertEqual ( proxy [ first_key ] , proxy . get ( first_key ) ) <EOL> self . assertEqual ( proxy . get ( '<STR_LIT>' , '<STR_LIT:foo>' ) , '<STR_LIT:foo>' ) <EOL> proxy_len = len ( proxy ) <EOL> self . assert_ ( isinstance ( proxy_len , int ) and proxy_len > <NUM_LIT:2> ) <EOL> self . assert_ ( proxy_len == len ( proxy . keys ( ) ) == len ( proxy . items ( ) ) == <EOL> len ( proxy . values ( ) ) == len ( list ( proxy . iterkeys ( ) ) ) == <EOL> len ( list ( proxy . iteritems ( ) ) ) == <EOL> len ( list ( proxy . itervalues ( ) ) ) ) <EOL> self . assert_ ( isinstance ( proxy . items ( ) [ <NUM_LIT:0> ] , tuple ) ) <EOL> self . assert_ ( isinstance ( proxy . iteritems ( ) . next ( ) , tuple ) ) <EOL> copy = proxy . copy ( ) <EOL> self . assert_ ( proxy is not copy ) <EOL> self . assertEqual ( len ( proxy ) , len ( copy ) ) <EOL> def test_dictproxy_equality ( self ) : <EOL> self . assertEqual ( type . __dict__ , type . __dict__ ) <EOL> self . assertEqual ( type . __dict__ , type . __dict__ . copy ( ) ) <EOL> self . assertEqual ( type . __dict__ , dict ( type . __dict__ ) ) <EOL> self . assertEqual ( cmp ( type . __dict__ , type . __dict__ ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( cmp ( type . __dict__ , type . __dict__ . copy ( ) ) , <NUM_LIT:0> ) <EOL> self . assertEqual ( cmp ( type . __dict__ , dict ( type . __dict__ ) ) , <NUM_LIT:0> ) <EOL> def test_main ( ) : <EOL> test_support . run_unittest ( DictproxyTestCase ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> test_main ( ) </s>
