Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(5)  |  Call(5)  |  Derive(0)  |  Import(0)

src/d/a/Dandelion-Message-Service-HEAD/dandelionpy/dandelion/network.py   Dandelion-Message-Service(Download)
                self._write(response_str.encode())
            elif dandelion.protocol.is_message_list_request(data):
                msgids = dandelion.protocol.parse_message_list_request(data)
                _, msgs = self._db.get_messages(msgids=msgids)
                response_str = dandelion.protocol.create_message_list(msgs)

src/d/a/Dandelion-Message-Service-HEAD/dandelionpy/dandelion/test/protocol_test.py   Dandelion-Message-Service(Download)
    def test_parse_message_list_request(self):
        """Test parsing the message list request string"""
 
        msgs = dandelion.protocol.parse_message_list_request('GETMESSAGES\n')
        self.assertEqual(msgs, None)
        m1_str = encode_b64_bytes(m1).decode()
 
        msgs_ret = dandelion.protocol.parse_message_list_request('GETMESSAGES {0}\n'.format(';'.join([m1_str, m2_str, m3_str])))
        self.assertEquals(len(msgs_ret), 3)
 
    def test_roundtrip_message_list_request(self):
        """Test message list request creation / parsing by a round trip"""
        msg = dandelion.protocol.create_message_list_request()
        res = dandelion.protocol.parse_message_list_request(msg)
        self.assertEqual(res, None)
 
        msg = dandelion.protocol.create_message_list_request([b'1', b'2'])
        res = dandelion.protocol.parse_message_list_request(msg)