mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 08:05:33 +03:00
db19671827
* Check Wallet DB integrity * Update command line help * Improve duplicate DerivationPath index error message * Move tests to chia/tests * lint * py init file * Print WalletType names * Don't complain about wallets not having derivation entries that don't need them * Validate addresses used in order * Update tests with new error output * Fix check_addresses_used_contiguous in the case when the last address of the previous wallet was unused
18 lines
653 B
Python
18 lines
653 B
Python
from __future__ import annotations
|
|
|
|
from chia.util.pprint import print_compact_ranges
|
|
|
|
|
|
def test_print_compact_ranges() -> None:
|
|
assert print_compact_ranges([]) == "[]"
|
|
assert print_compact_ranges([1]) == "[1]"
|
|
assert print_compact_ranges([1, 2]) == "[1 to 2]"
|
|
assert print_compact_ranges([2, 1]) == "[1 to 2]"
|
|
assert print_compact_ranges([1, 3, 4]) == "[1, 3 to 4]"
|
|
assert print_compact_ranges([1, 2, 4]) == "[1 to 2, 4]"
|
|
assert print_compact_ranges([1, 2, 4, 5]) == "[1 to 2, 4 to 5]"
|
|
|
|
assert print_compact_ranges([-1, -2]) == "[-2 to -1]"
|
|
|
|
assert print_compact_ranges([1, 1, 1, 2, 2, 4, 4, 9]) == "[1 to 2, 4, 9]"
|