|
1 | 1 | import copy
|
| 2 | +import logging |
2 | 3 | from dataclasses import replace
|
3 | 4 | from fractions import Fraction
|
4 | 5 | from test.pycardano.test_key import SK
|
@@ -220,6 +221,30 @@ def test_tx_builder_raises_utxo_selection(chain_context):
|
220 | 221 | assert "{AssetName(b'NewToken'): 1}" in e.value.args[0]
|
221 | 222 |
|
222 | 223 |
|
| 224 | +def test_tx_builder_state_logger_warning_level(chain_context, caplog): |
| 225 | + with caplog.at_level(logging.WARNING): |
| 226 | + test_tx_builder_raises_utxo_selection(chain_context) |
| 227 | + assert "WARNING" in caplog.text |
| 228 | + |
| 229 | + |
| 230 | +def test_tx_builder_state_logger_error_level(chain_context, caplog): |
| 231 | + with caplog.at_level(logging.ERROR): |
| 232 | + test_tx_builder_raises_utxo_selection(chain_context) |
| 233 | + assert "WARNING" not in caplog.text |
| 234 | + |
| 235 | + |
| 236 | +def test_tx_builder_state_logger_info_level(chain_context, caplog): |
| 237 | + with caplog.at_level(logging.INFO): |
| 238 | + test_tx_builder_multi_asset(chain_context) |
| 239 | + assert "DEBUG" not in caplog.text |
| 240 | + |
| 241 | + |
| 242 | +def test_tx_builder_state_logger_debug_level(chain_context, caplog): |
| 243 | + with caplog.at_level(logging.DEBUG): |
| 244 | + test_tx_builder_multi_asset(chain_context) |
| 245 | + assert "DEBUG" in caplog.text |
| 246 | + |
| 247 | + |
223 | 248 | def test_tx_too_big_exception(chain_context):
|
224 | 249 | tx_builder = TransactionBuilder(chain_context)
|
225 | 250 | sender = "addr_test1vrm9x2zsux7va6w892g38tvchnzahvcd9tykqf3ygnmwtaqyfg52x"
|
|
0 commit comments