def test_get_profile(self): doc = read_document(self.facade._desc.document.to_stream()) self.assertEquals("Mr", doc.get_title()) self.assertEquals("manu", doc.get_firstname()) self.assertEquals("breton", doc.get_lastname()) self.assertEquals(QUESTION_MARK(), doc.get_photo()) self.assertEquals("*****@*****.**", doc.get_email()) self.assertEquals({'City': u'', 'color': u'blue', 'Country': u'', 'Favourite Book': u'', 'homepage': u'manu.com', 'Favourite Movie': u'', 'Studies': u''}, doc.get_custom_attributes())
def _on_complete_profile(self, donwload_msg): """callback when finished downloading profile""" log("_on_complete_profile: ", self.peer.peer_id) return read_document(donwload_msg.file)
def _on_hello(self, donwload_msg): """callback when autoloading of profile successful""" log("_on_hello: ", self.peer.peer_id) document = read_document(donwload_msg.file) get_facade().set_data(self.peer.peer_id, document, flag_update=False) get_filter_facade().fill_data(self.peer.peer_id, document)