<s> from support . handler_fixture import StationHandlerTestCase <EOL> from groundstation . transfer . request_handlers import handle_listallchannels <EOL> from groundstation . gref import Gref , Tip <EOL> from groundstation . objects . root_object import RootObject <EOL> from groundstation . proto . channel_list_pb2 import ChannelList <EOL> class TestHandlerListAllChannels ( StationHandlerTestCase ) : <EOL> def test_handle_listallchannels ( self ) : <EOL> test_id = u"<STR_LIT>" <EOL> test_channel = u"<STR_LIT>" <EOL> test_protocol = u"<STR_LIT>" <EOL> obj = RootObject ( test_id , test_channel , test_protocol ) <EOL> gref = Gref ( self . station . station . store , test_channel , test_id ) <EOL> oid = self . station . station . write ( obj . as_object ( ) ) <EOL> self . station . station . update_gref ( gref , [ Tip ( oid , "<STR_LIT>" ) ] , [ ] ) <EOL> handle_listallchannels ( self . station ) <EOL> response = self . station . stream . pop ( ) <EOL> serialized_response = response . SerializeToString ( ) <EOL> self . assertIsInstance ( serialized_response , str ) <EOL> assert len ( self . station . stream ) == <NUM_LIT:0> , "<STR_LIT>" <EOL> channel_description = ChannelList ( ) <EOL> channel_description . ParseFromString ( response . payload ) <EOL> self . assertEqual ( channel_description . channels [ <NUM_LIT:0> ] . channelname , test_channel ) <EOL> self . assertEqual ( channel_description . channels [ <NUM_LIT:0> ] . grefs [ <NUM_LIT:0> ] . identifier , test_id ) <EOL> self . assertEqual ( channel_description . channels [ <NUM_LIT:0> ] . grefs [ <NUM_LIT:0> ] . tips [ <NUM_LIT:0> ] . tip , oid ) </s>
