#NEWLINE# def test_can_parse_parameter_string_with_params( ) : #NEWLINE# #INDENT# uri = URI ( 'http://example.com/foo/name;version=1.2/bar' ) #NEWLINE# path_segment = ParameterString ( path_segment . path . segments [ 2 ] , ';' ) #NEWLINE# assert ( str ( path_segment ) == 'name;version=1.2' ) #NEWLINE# assert ( path_segment . string == 'name;version=1.2' ) #NEWLINE# assert ( list ( path_segment ) == [ ( 'name' , None ) , ( 'version' , '1.2' ) ] ) #NEWLINE# assert ( len ( path_segment ) == 2 ) #NEWLINE# assert ( path_segment [ 0 ] == ( 'name' , None ) ) #NEWLINE# assert ( path_segment [ 1 ] == ( 'version' , '1.2' ) ) #NEWLINE# assert ( path_segment . get ( 'name' ) is None ) #NEWLINE# assert ( path_segment . get ( 'version' ) == '1.2' )