Rehabilitate tests
This commit is contained in:
		
							parent
							
								
									e03c5b8035
								
							
						
					
					
						commit
						7dc62676ba
					
				| @ -1,5 +1,6 @@ | ||||
| - 0.3.0 | ||||
| 	* Implement chainlib with new arg and config handling | ||||
| 	* Implement cli tools on settings module | ||||
| - 0.2.0 | ||||
| 	* Implement chainlib generic tx, block and tx result objects | ||||
| - 0.1.3 | ||||
|  | ||||
| @ -29,6 +29,7 @@ class TestBlock(unittest.TestCase): | ||||
|         tx_two_src_hash = os.urandom(32).hex() | ||||
| 
 | ||||
|         block_hash = os.urandom(32).hex() | ||||
|         parent_hash = os.urandom(32).hex() | ||||
|         block_author = os.urandom(20).hex() | ||||
|         block_time = datetime.datetime.utcnow().timestamp() | ||||
|         block_src = { | ||||
| @ -40,6 +41,9 @@ class TestBlock(unittest.TestCase): | ||||
|                 tx_two_src_hash, | ||||
|                 ], | ||||
|             'timestamp': block_time, | ||||
|             'gas_used': '0x1234', | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': parent_hash  | ||||
|                 } | ||||
|         block = Block(block_src) | ||||
| 
 | ||||
|  | ||||
| @ -21,6 +21,9 @@ class TestStat(unittest.TestCase): | ||||
|             'transactions': [], | ||||
|             'number': 41, | ||||
|             'author': os.urandom(20).hex(), | ||||
|             'gas_used': '0x1234', | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': None, | ||||
|             }) | ||||
| 
 | ||||
|         d = datetime.datetime.utcnow() | ||||
| @ -30,6 +33,9 @@ class TestStat(unittest.TestCase): | ||||
|             'transactions': [], | ||||
|             'number': 42, | ||||
|             'author': os.urandom(20).hex(), | ||||
|             'gas_used': '0x1234', | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': None, | ||||
|             }) | ||||
| 
 | ||||
|         s.block_apply(block_a) | ||||
| @ -43,6 +49,9 @@ class TestStat(unittest.TestCase): | ||||
|             'transactions': [], | ||||
|             'number': 43, | ||||
|             'author': os.urandom(20).hex(), | ||||
|             'gas_used': '0x1234', | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': None, | ||||
|             }) | ||||
| 
 | ||||
|         s.block_apply(block_c) | ||||
|  | ||||
| @ -130,6 +130,9 @@ class TxTestCase(EthTesterCase): | ||||
|             'timestamp': 13241324, | ||||
|             'transactions': [], | ||||
|             'author': os.urandom(20).hex(), | ||||
|             'gas_used': 21000, | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': None, | ||||
|             }) | ||||
|         with self.assertRaises(AttributeError): | ||||
|             tx = Tx(tx_data, block=block) | ||||
| @ -173,6 +176,9 @@ class TxTestCase(EthTesterCase): | ||||
|             'timestamp': 13241324, | ||||
|             'transactions': [], | ||||
|             'author': os.urandom(20).hex(), | ||||
|             'gas_used': 21000, | ||||
|             'gas_limit': '0x2345', | ||||
|             'parent_hash': None, | ||||
|             }) | ||||
| 
 | ||||
|         block.txs = [add_0x(tx_data['hash'])] | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user