def test_abnormal_021_getblockbyhash(self): try: (process, response) = API.restful().getblockbyhash( test_config.m_block_hash_error, 1) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_058_getsmartcodeeventbyheight(self, height=""): try: (process, response) = API.restful().getsmartcodeeventbyheight(height) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_032_gettransactionbytxhash(self): try: (process, response) = API.restful().gettransactionbytxhash( test_config.m_txhash_wrong) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_031_gettransactionbytxhash(self): try: (process, response) = API.restful().gettransactionbytxhash( test_config.m_txhash_right) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_027_getblockhashbyheight(self,height=65536): try: (process, response) = API.restful().getblockhashbyheight(height) rs = (response["Result"] == "" or response["Result"] == None) self.ASSERT(not process and rs, "") except Exception as e: logger.print(e.args[0])
def test_base_020_getblockbyhash(self): try: (process, response) = API.restful().getblockbyhash( test_config.m_block_hash_right, 1) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_049_getbalance(self): try: attr=test_config.getbalance_address_true (process, response) = API.restful().getbalance(attr) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_054_getcontract(self): try: script_hash=test_config.m_contractaddr_wrong (process, response) = API.restful().getcontract(script_hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_059_getsmartcodeeventbyhash(self): try: hash=test_config.m_txhash_right (process, response) = API.restful().getsmartcodeeventbyhash(hash) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_062_getsmartcodeeventbyhash(self): try: hash=test_config.m_txhash_wrong (process, response) = API.restful().getsmartcodeeventbyhash(hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_070_getmerkleproofbytxhash(self): try: hash=test_config.m_txhash_right (process, response) = API.restful().getmerkleproofbytxhash(hash) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_071_getmerkleproofbytxhash(self): try: hash=test_config.m_txhash_wrong (process, response) = API.restful().getmerkleproofbytxhash(hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_050_getbalance(self): try: attr=test_config.getbalance_address_false (process, response) = API.restful().getbalance(attr) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_052_getcontract(self): try: script_hash=test_config.m_contractaddr_right (process, response) = API.restful().getcontract(script_hash) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_048_getstorage(self): try: script_hash=test_config.m_getstorage_contract_addr key=test_config.m_getstorage_contract_key + "1111" (process, response) = API.restful().getstorage(script_hash, key) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_053_getcontract(self): try: # (contractaddr_right, txhash_right) = API.contract().deploy_contract_full(testpath+"/resource/A.neo", "name", "desc", 0) # time.sleep(10) script_hash = "8eeae0cd102461abc82a3fe5df58fa8c31121e0f" (process, response) = API.restful().getcontract(script_hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_001_getgenerateblocktime(self): try: API.node().stop_all_nodes() API.node().start_nodes([0, 1, 2, 3, 4, 5, 6], Config.DEFAULT_NODE_ARGS, True, True, config="config-dbft-1.json") time.sleep(10) (process, response) = API.restful().getgenerateblocktime() self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_041_postrawtx(self): try: rawtxdata="" action = "sendrawtransaction" version = "1.0.0" (process, response) = API.restful().postrawtx(rawtxdata,action,version) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_normal_039_postrawtx(self): try: (result, reponse) = API.contract().sign_transction(Task(testpath+"/resource/cli/siginvoketx.json"), False) rawtxdata=reponse["result"]["signed_tx"] action = "sendrawtransaction" version = "1.0.0" (process, response) = API.restful().postrawtx(rawtxdata,action,version) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_base_012_getblockbyheight(self,height=1): try: (process, response) = API.restful().getblockbyheight(height) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_normal_025_getblockhashbyheight(self,height=0): try: (process, response) = API.restful().getblockhashbyheight(height) self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_073_getmerkleproofbytxhash(self,hash=123): try: (process, response) = API.restful().getmerkleproofbytxhash(hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_base_003_getconnectioncount(self): try: (process, response) = API.restful().getconnectioncount() self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_068_getblockheightbytxhash(self,hash=""): try: (process, response) = API.restful().getblockheightbytxhash(hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_065_getsmartcodeeventbyhash(self,hash=""): try: (process, response) = API.restful().getsmartcodeeventbyhash(hash) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_normal_002_getgenerateblocktime(self): try: (process, response) = API.restful().getgenerateblocktime() self.ASSERT(process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_018_getblockbyheight(self,height=-1): try: (process, response) = API.restful().getblockbyheight(height) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])
def test_abnormal_051_getbalance(self,attr=""): try: (process, response) = API.restful().getbalance(attr) self.ASSERT(not process, "") except Exception as e: logger.print(e.args[0])