From f5f8775c59d54a7b7de945d31bd034a398bc9ff0 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Tue, 9 Nov 2021 18:14:29 -0500 Subject: [PATCH] fix test_colliding_short_id --- tests/integration/takeovers/test_resolve_command.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/integration/takeovers/test_resolve_command.py b/tests/integration/takeovers/test_resolve_command.py index 45d8dc6b1..57112cf92 100644 --- a/tests/integration/takeovers/test_resolve_command.py +++ b/tests/integration/takeovers/test_resolve_command.py @@ -153,11 +153,17 @@ class ResolveCommand(BaseResolveTestCase): await self.assertResolvesToClaimId( f'@abc#{colliding_claim_ids[0][:1]}', first_claim ) + collision_depth = 0 + for c1, c2 in zip(colliding_claim_ids[0], colliding_claim_ids[1]): + if c1 == c2: + collision_depth += 1 + else: + break await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[0][:2]}', colliding_claim_ids[0]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[0][:7]}', colliding_claim_ids[0]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[0][:17]}', colliding_claim_ids[0]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[0]}', colliding_claim_ids[0]) - await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[1][:3]}', colliding_claim_ids[1]) + await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[1][:collision_depth + 1]}', colliding_claim_ids[1]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[1][:7]}', colliding_claim_ids[1]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[1][:17]}', colliding_claim_ids[1]) await self.assertResolvesToClaimId(f'@abc#{colliding_claim_ids[1]}', colliding_claim_ids[1])