def test_filling(self):
     """fill data"""
     for document in self.documents:
         self.assertEquals(document.has_peer(u"emb"), False)
         bruce = get_bruce_profile()
         document.fill_data(u"emb", bruce.document)
         document.fill_blog(u"emb", bruce.blog)
 def __init__(self):
     NetworkTest.__init__(self)
     # create profiles used for tests
     write_test_profile() 
     bruce = get_bruce_profile()
     bruce.save(directory=PROFILE_DIR) 
     # call setUp once to set first_id & second_id
     self.setUp()
 def test_peers_status(self):
     """change status"""
     bruce = get_bruce_profile()
     for document in self.documents:
         self.assertRaises(AssertionError, document.make_friend, bruce.node_id)
         self.assertRaises(AssertionError, document.blacklist_peer, bruce.node_id)
         self.assertRaises(AssertionError, document.unmark_peer, bruce.node_id)
         document.set_peer(bruce.node_id, bruce)
         # friend
         document.make_friend(bruce.node_id)
         self.assertEquals(PeerDescriptor.FRIEND, document.get_peer(bruce.node_id).state)
         # blacklist
         document.blacklist_peer(bruce.node_id)
         self.assertEquals(PeerDescriptor.BLACKLISTED, document.get_peer(bruce.node_id).state)
         # anonmyous
         document.unmark_peer(bruce.node_id)
         self.assertEquals(PeerDescriptor.ANONYMOUS, document.get_peer(bruce.node_id).state)
 def test_creation(self):
     bruce = get_bruce_profile()
     self.assertEquals(bruce.node_id, PROFILE_BRUCE)
     self.assertEquals(bruce.blog[0].text, u'Hi Buddy')
     self.assertEquals(bruce.document.get_pseudo(), u'bruce')