#NEWLINE# def test_set( self ) : #NEWLINE# #INDENT# self . assertTrue ( self . kt_handle . clear ( ) ) #NEWLINE# error = self . kt_handle . error ( ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'key' , 'value' ) ) #NEWLINE# self . assertEqual ( error . code ( ) , error . SUCCESS ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'k e y' , 'v a l u e' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'k\te\ty' , 'tabbed' ) ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'key' ) , 'value' ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'k e y' ) , 'v a l u e' ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'k\te\ty' ) , 'tabbed' ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( '\\key' , '\\xxx' ) ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( '\\key' ) , '\\xxx' ) #NEWLINE# self . assertEqual ( self . kt_handle . count ( ) , 4 ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'tabbed\tkey' , 'tabbled\tvalue' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . get ( 'tabbed\tkey' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'url1' , 'http://github.com' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'url2' , 'https://github.com/' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'url3' , 'https://github.com/blog/' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'http://github.com' , 'url1' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'https://github.com' , 'url2' ) ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'https://github.com/blog/' , 'url3' ) ) #NEWLINE# self . assertFalse ( self . kt_handle . set ( None , 'value' ) ) #NEWLINE# self . assertEqual ( error . code ( ) , error . LOGIC ) #NEWLINE# self . assertFalse ( self . kt_handle . get ( None ) ) #NEWLINE# self . assertEqual ( error . code ( ) , error . LOGIC ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'non_existent' ) , None ) #NEWLINE# self . assertEqual ( error . code ( ) , error . NOTFOUND ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'cb' , 1791 ) ) #NEWLINE# self . assertEqual ( error . code ( ) , error . SUCCESS ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'cb' ) , 1791 ) #NEWLINE# self . assertEqual ( error . code ( ) , error . SUCCESS ) #NEWLINE# self . assertTrue ( self . kt_handle . set ( 'cb' , 1791.1226 ) ) #NEWLINE# self . assertEqual ( self . kt_handle . get ( 'cb' ) , 1791.1226 )