[qa] Remove misleading "errorString syntax"

This commit is contained in:
MarcoFalke
2016-04-03 21:20:14 +02:00
committed by lateminer
parent 0dd0d53057
commit 11fef29f9a
3 changed files with 13 additions and 17 deletions

View File

@@ -117,9 +117,10 @@ class ImportPrunedFundsTest(BitcoinTestFramework):
try:
self.nodes[1].removeprunedfunds(txnid1)
except JSONRPCException as e:
errorString = e.error['message']
assert('does not exist' in e.error['message'])
else:
assert(False)
assert('does not exist' in errorString)
balance1 = self.nodes[1].getbalance("*", 0, True)
assert_equal(balance1, Decimal('0.075'))

View File

@@ -56,13 +56,13 @@ class RawTransactionsTest(BitcoinTestFramework):
rawtx = self.nodes[2].createrawtransaction(inputs, outputs)
rawtx = self.nodes[2].signrawtransaction(rawtx)
errorString = ""
try:
rawtx = self.nodes[2].sendrawtransaction(rawtx['hex'])
except JSONRPCException as e:
errorString = e.error['message']
assert("Missing inputs" in e.error['message'])
else:
assert(False)
assert("Missing inputs" in errorString)
#########################
# RAW TX MULTISIG TESTS #

View File

@@ -246,22 +246,20 @@ class WalletTest (BitcoinTestFramework):
txObj = self.nodes[0].gettransaction(txId)
assert_equal(txObj['amount'], Decimal('-0.0001'))
#this should fail
errorString = ""
try:
txId = self.nodes[0].sendtoaddress(self.nodes[2].getnewaddress(), "1f-4")
except JSONRPCException as e:
errorString = e.error['message']
assert("Invalid amount" in e.error['message'])
else:
raise AssertionError("Must not parse invalid amounts")
assert("Invalid amount" in errorString)
errorString = ""
try:
self.nodes[0].generate("2") #use a string to as block amount parameter must fail because it's not interpreted as amount
self.nodes[0].generate("2")
raise AssertionError("Must not accept strings as numeric")
except JSONRPCException as e:
errorString = e.error['message']
assert("not an integer" in e.error['message'])
assert("not an integer" in errorString)
# Mine a block from node0 to an address from node1
cbAddr = self.nodes[1].getnewaddress()
@@ -270,10 +268,7 @@ class WalletTest (BitcoinTestFramework):
self.sync_all()
# Check that the txid and balance is found by node1
try:
self.nodes[1].gettransaction(cbTxId)
except JSONRPCException as e:
assert("Invalid or non-wallet transaction id" not in e.error['message'])
self.nodes[1].gettransaction(cbTxId)
#check if wallet or blochchain maintenance changes the balance
self.sync_all()