<s> import xml . sax <EOL> from tests . unit import unittest <EOL> import boto . resultset <EOL> from boto . ec2 . elb . loadbalancer import LoadBalancer <EOL> from boto . ec2 . elb . listener import Listener <EOL> LISTENERS_RESPONSE = b"""<STR_LIT>""" <EOL> class TestListenerResponseParsing ( unittest . TestCase ) : <EOL> def test_parse_complex ( self ) : <EOL> rs = boto . resultset . ResultSet ( [ <EOL> ( '<STR_LIT>' , LoadBalancer ) <EOL> ] ) <EOL> h = boto . handler . XmlHandler ( rs , None ) <EOL> xml . sax . parseString ( LISTENERS_RESPONSE , h ) <EOL> listeners = rs [ <NUM_LIT:0> ] . listeners <EOL> self . assertEqual ( <EOL> sorted ( [ l . get_complex_tuple ( ) for l in listeners ] ) , <EOL> [ <EOL> ( <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ( <NUM_LIT> , <NUM_LIT> , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ] <EOL> ) <EOL> class TestListenerGetItem ( unittest . TestCase ) : <EOL> def test_getitem_for_http_listener ( self ) : <EOL> listener = Listener ( load_balancer_port = <NUM_LIT> , <EOL> instance_port = <NUM_LIT> , <EOL> protocol = '<STR_LIT>' , <EOL> instance_protocol = '<STR_LIT>' ) <EOL> self . assertEqual ( listener [ <NUM_LIT:0> ] , <NUM_LIT> ) <EOL> self . assertEqual ( listener [ <NUM_LIT:1> ] , <NUM_LIT> ) <EOL> self . assertEqual ( listener [ <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> self . assertEqual ( listener [ <NUM_LIT:3> ] , '<STR_LIT>' ) <EOL> def test_getitem_for_https_listener ( self ) : <EOL> listener = Listener ( load_balancer_port = <NUM_LIT> , <EOL> instance_port = <NUM_LIT> , <EOL> protocol = '<STR_LIT>' , <EOL> instance_protocol = '<STR_LIT>' , <EOL> ssl_certificate_id = '<STR_LIT>' ) <EOL> self . assertEqual ( listener [ <NUM_LIT:0> ] , <NUM_LIT> ) <EOL> self . assertEqual ( listener [ <NUM_LIT:1> ] , <NUM_LIT> ) <EOL> self . assertEqual ( listener [ <NUM_LIT:2> ] , '<STR_LIT>' ) <EOL> self . assertEqual ( listener [ <NUM_LIT:3> ] , '<STR_LIT>' ) <EOL> self . assertEqual ( listener [ <NUM_LIT:4> ] , '<STR_LIT>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
