Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
[LC-272] monkeypatch configure value in test_custom_tx_value
Browse files Browse the repository at this point in the history
 - changing the configure value directly can affect other test cases
  • Loading branch information
yakkle committed Feb 6, 2020
1 parent 7ecfafc commit ceb2e3a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions testcase/unittest/test_tx_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ def test_tx_messages(self, tx_items: List[Tuple[Transaction, TransactionVersione
class TestTxMessagesQueue:
tx_count = 50

def test_custom_tx_value(self):
def test_custom_tx_value(self, monkeypatch):
# given custom max_tx_size and max_tx_count
given_max_tx_size = 1024
given_max_tx_count = 100

configure.MAX_TX_SIZE_IN_BLOCK = given_max_tx_size
configure.MAX_TX_COUNT_IN_ADDTX_LIST = given_max_tx_count
monkeypatch.setattr(configure, "MAX_TX_SIZE_IN_BLOCK", given_max_tx_size)
monkeypatch.setattr(configure, "MAX_TX_COUNT_IN_ADDTX_LIST", given_max_tx_count)
Logger.info(f"MAX_TX_SIZE_IN_BLOCK : {configure.MAX_TX_SIZE_IN_BLOCK}")
Logger.info(f"MAX_TX_COUNT_IN_ADDTX_LIST : {configure.MAX_TX_COUNT_IN_ADDTX_LIST}")

# when create TxMessagesQueue instance
queue = TxMessagesQueue()
Expand Down

0 comments on commit ceb2e3a

Please sign in to comment.