Skip to content

Commit

Permalink
Separated PubSub community
Browse files Browse the repository at this point in the history
  • Loading branch information
xoriole committed Jun 29, 2018
1 parent dc71fd5 commit a9fe9da
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 164 deletions.
10 changes: 5 additions & 5 deletions Tribler/Test/Community/popular/test_community.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def on_torrent_health_response(peer, source_address, data):
health_info = ('a' * 20, random.randint(1, 100), random.randint(1, 10), random.randint(1, 111111))
self.nodes[1].overlay._queue_content(TYPE_TORRENT_HEALTH, health_info)

self.nodes[1].overlay._publish_next_content()
self.nodes[1].overlay.publish_next_content()

yield self.deliver_messages()

Expand All @@ -212,7 +212,7 @@ def test_publish_no_content(self):

# Try publishing the next available content
self.nodes[0].no_content = False
self.nodes[0].overlay._publish_next_content()
self.nodes[0].overlay.publish_next_content()
yield self.deliver_messages()

# Expect no content found to be logged
Expand Down Expand Up @@ -416,7 +416,7 @@ def fake_get_peer_from_auth(peer):
return peer

self.nodes[0].overlay._ez_unpack_auth = lambda payload_class, data: fake_unpack_auth()
self.nodes[0].overlay._get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])
self.nodes[0].overlay.get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])

source_address = MockObject()
data = MockObject()
Expand Down Expand Up @@ -452,7 +452,7 @@ def fake_publish_latest_torrents(my_peer, _peer):

self.nodes[0].overlay._publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[1], peer)
self.nodes[0].overlay._ez_unpack_auth = lambda payload_class, data: fake_unpack_auth()
self.nodes[0].overlay._get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])
self.nodes[0].overlay.get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])

source_address = MockObject()
data = MockObject()
Expand Down Expand Up @@ -491,7 +491,7 @@ def fake_send_popular_content_subscription(my_peer):

self.nodes[0].overlay._publish_latest_torrents = lambda peer: fake_publish_latest_torrents(self.nodes[0], peer)
self.nodes[0].overlay._ez_unpack_auth = lambda payload_class, data: fake_unpack_auth()
self.nodes[0].overlay._get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])
self.nodes[0].overlay.get_peer_from_auth = lambda auth, address: fake_get_peer_from_auth(self.nodes[1])
self.nodes[0].overlay.send_popular_content_subscription = lambda peer, subscribed: \
fake_send_popular_content_subscription(self.nodes[1])

Expand Down
Loading

0 comments on commit a9fe9da

Please sign in to comment.