<s> from bpython import keys <EOL> from bpython . test import unittest <EOL> class TestCLIKeys ( unittest . TestCase ) : <EOL> def test_keymap_map ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( len ( keys . cli_key_dispatch . map ) , <NUM_LIT> ) <EOL> def test_keymap_setitem ( self ) : <EOL> """<STR_LIT>""" <EOL> keys . cli_key_dispatch [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> self . assertEqual ( keys . cli_key_dispatch [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_keymap_delitem ( self ) : <EOL> """<STR_LIT>""" <EOL> keys . cli_key_dispatch [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> del keys . cli_key_dispatch [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in keys . cli_key_dispatch . map : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def test_keymap_getitem ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( keys . cli_key_dispatch [ '<STR_LIT>' ] , ( chr ( <NUM_LIT> ) , '<STR_LIT>' ) ) <EOL> self . assertEqual ( keys . cli_key_dispatch [ '<STR_LIT>' ] , ( '<STR_LIT>' , ) ) <EOL> self . assertEqual ( keys . cli_key_dispatch [ '<STR_LIT>' ] , ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> def test_keymap_keyerror ( self ) : <EOL> """<STR_LIT>""" <EOL> with self . assertRaises ( KeyError ) : <EOL> keys . cli_key_dispatch [ '<STR_LIT>' ] <EOL> keys . cli_key_dispatch [ '<STR_LIT>' ] <EOL> class TestUrwidKeys ( unittest . TestCase ) : <EOL> def test_keymap_map ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( len ( keys . urwid_key_dispatch . map ) , <NUM_LIT:64> ) <EOL> def test_keymap_setitem ( self ) : <EOL> """<STR_LIT>""" <EOL> keys . urwid_key_dispatch [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> self . assertEqual ( keys . urwid_key_dispatch [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_keymap_delitem ( self ) : <EOL> """<STR_LIT>""" <EOL> keys . urwid_key_dispatch [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> del keys . urwid_key_dispatch [ '<STR_LIT>' ] <EOL> if '<STR_LIT>' in keys . urwid_key_dispatch . map : <EOL> raise Exception ( '<STR_LIT>' ) <EOL> def test_keymap_getitem ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertEqual ( keys . urwid_key_dispatch [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( keys . urwid_key_dispatch [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> self . assertEqual ( keys . urwid_key_dispatch [ '<STR_LIT>' ] , '<STR_LIT>' ) <EOL> def test_keymap_keyerror ( self ) : <EOL> """<STR_LIT>""" <EOL> with self . assertRaises ( KeyError ) : <EOL> keys . urwid_key_dispatch [ '<STR_LIT>' ] <EOL> keys . urwid_key_dispatch [ '<STR_LIT>' ] <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
