mirror of
git://holbrook.no/eth-token-index
synced 2024-12-12 08:46:09 +01:00
Rehabilitate tests
This commit is contained in:
parent
4d1da0c7c7
commit
e289ad09ca
@ -85,6 +85,18 @@ class TokenUniqueSymbolIndex(TxFactory):
|
||||
return tx
|
||||
|
||||
|
||||
def add_writer(self, contract_address, sender_address, address, tx_format=TxFormat.JSONRPC, id_generator=None):
|
||||
enc = ABIContractEncoder()
|
||||
enc.method('addWriter')
|
||||
enc.typ(ABIContractType.ADDRESS)
|
||||
enc.address(address)
|
||||
data = enc.get()
|
||||
tx = self.template(sender_address, contract_address, use_nonce=True)
|
||||
tx = self.set_code(tx, data)
|
||||
tx = self.finalize(tx, tx_format)
|
||||
return tx
|
||||
|
||||
|
||||
def address_of(self, contract_address, token_symbol, sender_address=ZERO_ADDRESS, id_generator=None):
|
||||
j = JSONRPCRequest(id_generator)
|
||||
o = j.template()
|
||||
|
14
python/run_tests.sh
Normal file
14
python/run_tests.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
default_pythonpath=$PYTHONPATH:.
|
||||
export PYTHONPATH=${default_pythonpath:-.}
|
||||
for f in `ls tests/*.py`; do
|
||||
python $f
|
||||
if [ $? -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
set +x
|
||||
set +e
|
@ -45,6 +45,13 @@ class TestTokenUniqueSymbolIndex(TestAddressDeclaratorBase):
|
||||
|
||||
self.token_index_address = r['contract_address']
|
||||
|
||||
(tx_hash_hex, o) = c.add_writer(self.token_index_address, self.accounts[0], self.accounts[0])
|
||||
self.rpc.do(o)
|
||||
|
||||
o = receipt(tx_hash_hex)
|
||||
r = self.rpc.do(o)
|
||||
self.assertEqual(r['status'], 1)
|
||||
|
||||
|
||||
def test_register(self):
|
||||
nonce_oracle = RPCNonceOracle(self.accounts[0], self.rpc)
|
||||
|
Loading…
Reference in New Issue
Block a user