Fix method signature mismatch in subclass

This commit is contained in:
Michał Sałaban 2018-01-11 03:12:08 +01:00
parent 0be3652c29
commit 4be870c50b
2 changed files with 3 additions and 1 deletions

View File

@ -63,7 +63,7 @@ class Address(object):
class SubAddress(Address):
_valid_netbytes = (42, 63)
def with_payment_id(self):
def with_payment_id(self, _):
raise TypeError("SubAddress cannot be integrated with payment ID")

View File

@ -78,6 +78,8 @@ class Tests(object):
a = Address(self.addr)
self.assertRaises(TypeError, a.with_payment_id, 2**64+1)
self.assertRaises(TypeError, a.with_payment_id, "%x" % (2**64+1))
s = SubAddress(self.subaddr)
self.assertRaises(TypeError, s.with_payment_id, 0)
def test_type_mismatch(self):
self.assertRaises(ValueError, Address, self.iaddr)