tests: match API change
This commit is contained in:
parent
c499fce9f5
commit
0474c39bab
|
@ -28,7 +28,7 @@ class New(ServerBase, unittest.TestCase):
|
||||||
|
|
||||||
@inlineCallbacks
|
@inlineCallbacks
|
||||||
def test_allocate(self):
|
def test_allocate(self):
|
||||||
w = wormhole.deferred_wormhole(APPID, self.relayurl, reactor)
|
w = wormhole.create(APPID, self.relayurl, reactor)
|
||||||
#w.debug_set_trace("W1")
|
#w.debug_set_trace("W1")
|
||||||
w.allocate_code(2)
|
w.allocate_code(2)
|
||||||
code = yield w.when_code()
|
code = yield w.when_code()
|
||||||
|
@ -40,18 +40,19 @@ class New(ServerBase, unittest.TestCase):
|
||||||
|
|
||||||
def test_delegated(self):
|
def test_delegated(self):
|
||||||
dg = Delegate()
|
dg = Delegate()
|
||||||
w = wormhole.delegated_wormhole(APPID, self.relayurl, reactor, dg)
|
w = wormhole.create(APPID, self.relayurl, reactor, delegate=dg)
|
||||||
w.close()
|
w.close()
|
||||||
|
|
||||||
@inlineCallbacks
|
@inlineCallbacks
|
||||||
def test_basic(self):
|
def test_basic(self):
|
||||||
w1 = wormhole.deferred_wormhole(APPID, self.relayurl, reactor)
|
w1 = wormhole.create(APPID, self.relayurl, reactor)
|
||||||
#w1.debug_set_trace("W1")
|
#w1.debug_set_trace("W1")
|
||||||
w1.allocate_code(2)
|
w1.allocate_code(2)
|
||||||
code = yield w1.when_code()
|
code = yield w1.when_code()
|
||||||
mo = re.search(r"^\d+-\w+-\w+$", code)
|
mo = re.search(r"^\d+-\w+-\w+$", code)
|
||||||
self.assert_(mo, code)
|
self.assert_(mo, code)
|
||||||
w2 = wormhole.deferred_wormhole(APPID, self.relayurl, reactor)
|
w2 = wormhole.create(APPID, self.relayurl, reactor)
|
||||||
|
#w2.debug_set_trace(" W2")
|
||||||
w2.set_code(code)
|
w2.set_code(code)
|
||||||
code2 = yield w2.when_code()
|
code2 = yield w2.when_code()
|
||||||
self.assertEqual(code, code2)
|
self.assertEqual(code, code2)
|
||||||
|
@ -72,11 +73,11 @@ class New(ServerBase, unittest.TestCase):
|
||||||
|
|
||||||
@inlineCallbacks
|
@inlineCallbacks
|
||||||
def test_wrong_password(self):
|
def test_wrong_password(self):
|
||||||
w1 = wormhole.deferred_wormhole(APPID, self.relayurl, reactor)
|
w1 = wormhole.create(APPID, self.relayurl, reactor)
|
||||||
#w1.debug_set_trace("W1")
|
#w1.debug_set_trace("W1")
|
||||||
w1.allocate_code(2)
|
w1.allocate_code(2)
|
||||||
code = yield w1.when_code()
|
code = yield w1.when_code()
|
||||||
w2 = wormhole.deferred_wormhole(APPID, self.relayurl, reactor)
|
w2 = wormhole.create(APPID, self.relayurl, reactor)
|
||||||
w2.set_code(code+", NOT")
|
w2.set_code(code+", NOT")
|
||||||
code2 = yield w2.when_code()
|
code2 = yield w2.when_code()
|
||||||
self.assertNotEqual(code, code2)
|
self.assertNotEqual(code, code2)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user