Permalink
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (25 sloc) 1.5 KB
import walkingliberty
import re
def test_version():
version = walkingliberty.__version__
assert bool(re.match(r'^(\d+)\.(\d+)\.(\d+)$', version))
def test_address_determinism():
WalkingLiberty = walkingliberty.WalkingLiberty()
assert WalkingLiberty.address('PotatoCancer541AlphaFartz') == '1MiD4qj3T668cPonjNYcYDzZSYTgHJvdiy'
assert WalkingLiberty.address('satoshi') == '1xm4vFerV3pSgvBFkyzLgT1Ew3HQYrS1V'
WalkingLibertyBCH = walkingliberty.WalkingLiberty(currency='bch')
assert WalkingLibertyBCH.address('PotatoCancer541AlphaFartz') == 'bitcoincash:qr3jmfrezg4a0rhvntwr7rdqcnfxluqddvc606jtsj'
assert WalkingLibertyBCH.address('satoshi') == 'bitcoincash:qq9gh20y2vur63tpe0xa5dh90zwzsuxagyhp7pfuv3'
WalkingLibertyWIF = walkingliberty.WalkingLiberty(wallet_mode='wif')
assert WalkingLibertyWIF.address('5JN8q7UXFvsUTMuwePHxzd9byVGaeKvmMA6ZdV4fS4gYYiptMUc') == '1coinNJHaeuAN5io49RtDfryxFLWnKR15'
def test_address_balance():
"""
Should be zero unless someone sends to it.
"""
WalkingLiberty = walkingliberty.WalkingLiberty()
assert WalkingLiberty.balance('ShouldTotallyBeZeroBalance') == 0
assert WalkingLiberty.balance('PotatoCancer541AlphaFartz') == 0
WalkingLibertyBCH = walkingliberty.WalkingLiberty(currency='bch')
assert WalkingLibertyBCH.balance('ShouldTotallyBeZeroBalance') == 0
WalkingLibertyWIF = walkingliberty.WalkingLiberty(wallet_mode='wif')
assert WalkingLibertyWIF.balance('5JN8q7UXFvsUTMuwePHxzd9byVGaeKvmMA6ZdV4fS4gYYiptMUc') == 0