Skip to content

Commit 2a491d9

Browse files
committed
test(pools): update metadata URL length for 128-char limit
Increase the minimum generated metadata URL length in the negative pool registration test to 129 characters, reflecting the new 128-character limit (was 64). Update assertions and error message checks accordingly. Also increase hypothesis max_examples for broader coverage. Retain backward compatibility for cardano-node <= 10.6.0 by checking for the old error message.
1 parent 04506d7 commit 2a491d9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

cardano_node_tests/tests/test_pools.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2470,9 +2470,9 @@ def test_stake_pool_metadata_long_homepage(
24702470

24712471
@allure.link(helpers.get_vcs_link())
24722472
@hypothesis.given(
2473-
url_part=st.text(alphabet=st.characters(blacklist_categories=["C"]), min_size=25)
2473+
url_part=st.text(alphabet=st.characters(blacklist_categories=["C"]), min_size=89)
24742474
)
2475-
@common.hypothesis_settings()
2475+
@common.hypothesis_settings(max_examples=500)
24762476
@pytest.mark.smoke
24772477
@pytest.mark.testnets
24782478
def test_stake_pool_long_metadata_url(
@@ -2491,7 +2491,7 @@ def test_stake_pool_long_metadata_url(
24912491
common.get_test_id(cluster)
24922492

24932493
pool_metadata_url = f"https://gist.githubusercontent.com/{url_part}.json"
2494-
assert len(pool_metadata_url) >= 65
2494+
assert len(pool_metadata_url) >= 129
24952495

24962496
pool_name, pool_metadata_hash, node_vrf, node_cold = gen_pool_registration_cert_data
24972497

@@ -2514,8 +2514,11 @@ def test_stake_pool_long_metadata_url(
25142514
)
25152515
err_str = str(excinfo.value)
25162516
assert (
2517-
"option --metadata-url: The provided string must have at most 64 characters" in err_str
2517+
"option --metadata-url: The provided string must have at most 128 characters" in err_str
25182518
or "invalid url" in err_str
2519+
# In cardano-node <= 10.6.0
2520+
or "option --metadata-url: The provided string must have at most 64 characters"
2521+
in err_str
25192522
)
25202523

25212524

0 commit comments

Comments
 (0)