From 986f3979fb8bd77d2c87ecb15330a70f6b14672b Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Wed, 2 Oct 2024 15:50:52 +0300 Subject: [PATCH] use a dynamic public_key --- menu_traversal_test.go | 10 +++++++--- test_data.json | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/menu_traversal_test.go b/menu_traversal_test.go index 3bf88fd..77ff5de 100644 --- a/menu_traversal_test.go +++ b/menu_traversal_test.go @@ -659,10 +659,14 @@ func TestMyAccount_MyAddress(t *testing.T) { t.Errorf("Test case '%s' failed during Flush: %v", group.Name, err) } b := w.Bytes() - if !bytes.Equal(b, []byte(step.ExpectedContent)) { - t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", step.ExpectedContent, b) - } + publicKey := extractPublicKey(b) + + expectedContent := bytes.Replace([]byte(step.ExpectedContent), []byte("{public_key}"), []byte(publicKey), -1) + + if !bytes.Equal(b, expectedContent) { + t.Fatalf("expected:\n\t%s\ngot:\n\t%s\n", expectedContent, b) + } } } } diff --git a/test_data.json b/test_data.json index 405d3b7..5967788 100644 --- a/test_data.json +++ b/test_data.json @@ -583,7 +583,7 @@ }, { "input": "6", - "expectedContent": "Address: 0xdF8CB1D9b5BDaE418E5Bee107031cA7d933906CD\n9:Quit" + "expectedContent": "Address: {public_key}\n9:Quit" }, { "input": "9",