Skip to content

Commit e613daa

Browse files
committed
test: add test for checking hmac algo
1 parent ecd776d commit e613daa

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tests/test_cluster.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import uuid
2+
3+
from silverback.cluster.types import ClusterConfiguration
4+
5+
6+
def test_hmac_signature():
7+
config = ClusterConfiguration()
8+
cluster_id = uuid.uuid4()
9+
owner = "0x4838B106FCe9647Bdf1E7877BF73cE8B0BAD5f97"
10+
product_code = config.get_product_code(owner, cluster_id)
11+
# NOTE: Ensure we can properly decode the encoded product code into a configuration
12+
assert config == ClusterConfiguration.decode(product_code[:16])
13+
assert config.validate_product_code(owner, product_code[16:], cluster_id)

0 commit comments

Comments
 (0)