#NEWLINE# def testSingle( self ) : #NEWLINE# #INDENT# l = list ( read_client_registrations ( '' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 0 ) #NEWLINE# l = list ( read_client_registrations ( 'client=1.2.3.4:1111' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 1 ) #NEWLINE# self . assertEqual ( l [ 0 ] . addr , ( '1.2.3.4' , 1111 ) ) #NEWLINE# l = list ( read_client_registrations ( 'client=1.2.3.4:1111\n' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 1 ) #NEWLINE# self . assertEqual ( l [ 0 ] . addr , ( '1.2.3.4' , 1111 ) ) #NEWLINE# l = list ( read_client_registrations ( 'foo=bar&client=1.2.3.4:1111&baz=quux' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 1 ) #NEWLINE# self . assertEqual ( self [ 0 ] . addr , ( '1.2.3.4' , 1111 ) ) #NEWLINE# l = list ( read_client_registrations ( 'foo=b%3dar&client=1.2.3.4%3a1111' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 1 ) #NEWLINE# self . assertEqual ( l [ 0 ] . addr , ( '1.2.3.4' , 1111 ) ) #NEWLINE# l = list ( read_client_registrations ( 'client=%5b1::2%5d:3333' ) ) #NEWLINE# self . assertEqual ( len ( l ) , 1 ) #NEWLINE# self . assertEqual ( l [ 0 ] . addr , ( '1::2' , 3333 ) )