Skip to content

Commit 0cb0e9f

Browse files
committed
Refactor progress
1 parent 5e3a1ab commit 0cb0e9f

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

system_tests/test_psrd_usage.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _check_client_psrd_consumption(
3636
for_client_name: str, # * for all clients
3737
for_peer_hub_name: str, # * for all hubs
3838
for_local_or_peer: str,
39-
expected_consumed_lst: List[int],
39+
expected_used_lst: List[int],
4040
):
4141
"""
4242
Check the PSRD consumption for a given pool (local or remote) on a given (or all) client(s)
@@ -59,18 +59,18 @@ def _check_client_psrd_consumption(
5959
block_statuses = peer_hub_status[f"{local_or_peer}_pool"][
6060
"blocks"
6161
]
62-
assert len(block_statuses) == len(expected_consumed_lst)
63-
for block_status, expected_consumed in zip(
64-
block_statuses, expected_consumed_lst
62+
assert len(block_statuses) == len(expected_used_lst)
63+
for block_status, expected_used in zip(
64+
block_statuses, expected_used_lst
6565
):
66-
assert block_status["consumed"] == expected_consumed
66+
assert block_status["nr_used_bytes"] == expected_used
6767

6868

6969
def _check_hub_psrd_consumption(
7070
for_hub_name: str, # * for all clients
7171
for_peer_client_name: str, # * for all hubs
7272
for_local_or_peer: str,
73-
expected_consumed_lst: List[int],
73+
expected_used_lst: List[int],
7474
):
7575
"""
7676
Check the PSRD consumption for a given pool (local or remote) on a given (or all) client(s)
@@ -93,18 +93,18 @@ def _check_hub_psrd_consumption(
9393
block_statuses = peer_client_status[
9494
f"{local_or_peer}_pool"
9595
]["blocks"]
96-
assert len(block_statuses) == len(expected_consumed_lst)
97-
for block_status, expected_consumed in zip(
98-
block_statuses, expected_consumed_lst
96+
assert len(block_statuses) == len(expected_used_lst)
97+
for block_status, expected_used in zip(
98+
block_statuses, expected_used_lst
9999
):
100-
assert block_status["consumed"] == expected_consumed
100+
assert block_status["nr_used_bytes"] == expected_used
101101

102102

103103
def test_psrd_usage_one_small_key():
104104
"""
105105
Test PSRD usage when establishing one small key (small enough to fit in one block).
106106
"""
107-
# Check no PSRD consumed at start (out-of-band messages are not signed nor encrypted)
107+
# Check no PSRD used at start (out-of-band messages are not signed nor encrypted)
108108
_check_client_psrd_consumption("*", "*", "*", [0])
109109
_check_hub_psrd_consumption("*", "*", "*", [0])
110110

@@ -137,7 +137,7 @@ def test_psrd_usage_two_small_keys():
137137
Test PSRD usage when establishing two small keys (small enough for both keys to fit in one
138138
block).
139139
"""
140-
# Check no PSRD consumed at start (out-of-band messages are not signed nor encrypted)
140+
# Check no PSRD used at start (out-of-band messages are not signed nor encrypted)
141141
_check_client_psrd_consumption("*", "*", "*", [0])
142142
_check_hub_psrd_consumption("*", "*", "*", [0])
143143

@@ -175,10 +175,10 @@ def test_psrd_usage_refresh():
175175
Test PSRD usage when establishing one key, large enough to cause the pool size to drop below
176176
the threshold for requesting more PSRD. To be more precise:
177177
- Any pool from which both a signing key and an encryption key are allocated requests a new
178-
block. The first block will be partly consumed. The second block will have nothing consumed.
178+
block. The first block will be partly used. The second block will have nothing used.
179179
- Any pool from which only a signing key is allocated does not request a new block.
180180
"""
181-
# Check no PSRD consumed at start (out-of-band messages are not signed nor encrypted)
181+
# Check no PSRD used at start (out-of-band messages are not signed nor encrypted)
182182
_check_client_psrd_consumption("*", "*", "*", [0])
183183
_check_hub_psrd_consumption("*", "*", "*", [0])
184184

0 commit comments

Comments
 (0)