Skip to content

Commit

Permalink
fixed testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
forrestv committed Jun 27, 2015
1 parent ab7cfb5 commit bcfbe7f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2pool/test/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from twisted.trial import unittest
from twisted.web import client, resource, server

from p2pool import data, node, work
from p2pool import data, node, work, main
from p2pool.bitcoin import data as bitcoin_data, networks, worker_interface
from p2pool.util import deferral, jsonrpc, math, variable

Expand Down Expand Up @@ -154,8 +154,8 @@ def start(cls, net, factory, bitcoind, peer_ports, merged_urls):

self.n.p2p_node = node.P2PNode(self.n, port=0, max_incoming_conns=1000000, addr_store={}, connect_addrs=[('127.0.0.1', peer_port) for peer_port in peer_ports])
self.n.p2p_node.start()
wb = work.WorkerBridge(node=self.n, my_pubkey_hash=random.randrange(2**160), donation_percentage=random.uniform(0, 10), merged_urls=merged_urls, worker_fee=3)

wb = work.WorkerBridge(node=self.n, my_pubkey_hash=random.randrange(2**160), donation_percentage=random.uniform(0, 10), merged_urls=merged_urls, worker_fee=3, args=math.Object(donation_percentage=random.uniform(0, 10), address='foo', worker_fee=3, timeaddresses=1000), pubkeys=main.keypool(), bitcoind=bitcoind)
self.wb = wb
web_root = resource.Resource()
worker_interface.WorkerInterface(wb).attach_to(web_root)
Expand All @@ -182,7 +182,7 @@ def test_node(self):
n = node.Node(bitd, bitd, [], [], mynet)
yield n.start()

wb = work.WorkerBridge(node=n, my_pubkey_hash=42, donation_percentage=2, merged_urls=[('http://127.0.0.1:%i' % (mm_port.getHost().port,), '')], worker_fee=3)
wb = work.WorkerBridge(node=n, my_pubkey_hash=42, donation_percentage=2, merged_urls=[('http://127.0.0.1:%i' % (mm_port.getHost().port,), '')], worker_fee=3, args=math.Object(donation_percentage=2, address='foo', worker_fee=3, timeaddresses=1000), pubkeys=main.keypool(), bitcoind=bitd)
web_root = resource.Resource()
worker_interface.WorkerInterface(wb).attach_to(web_root)
port = reactor.listenTCP(0, server.Site(web_root))
Expand Down Expand Up @@ -241,7 +241,7 @@ def test_nodes(self):
# crawl web pages
from p2pool import web
stop_event = variable.Event()
web2_root = web.get_web_root(nodes[0].wb, tempfile.mkdtemp(), variable.Variable(None), stop_event)
web2_root = web.get_web_root(nodes[0].wb, tempfile.mkdtemp(), variable.Variable({'errors': '', 'version': 100000}), stop_event)
web2_port = reactor.listenTCP(0, server.Site(web2_root))
for name in web2_root.listNames() + ['web/' + x for x in web2_root.getChildWithDefault('web', None).listNames()]:
if name in ['web/graph_data', 'web/share', 'web/share_data']: continue
Expand Down

0 comments on commit bcfbe7f

Please sign in to comment.