match step expected content after replacing actual data

This commit is contained in:
Carlosokumu 2024-10-09 22:22:23 +03:00
parent 8791753b2a
commit 85efd2ac6e
Signed by: carlos
GPG Key ID: 7BD6BC8160A5C953

View File

@ -160,6 +160,7 @@ func TestSendWithInvalidInputs(t *testing.T) {
// Replace placeholder {public_key} with the actual dynamic public key // Replace placeholder {public_key} with the actual dynamic public key
expectedContent := bytes.Replace([]byte(step.ExpectedContent), []byte("{public_key}"), []byte(publicKey), -1) expectedContent := bytes.Replace([]byte(step.ExpectedContent), []byte("{public_key}"), []byte(publicKey), -1)
step.ExpectedContent = string(expectedContent)
match, err := step.MatchesExpectedContent(b) match, err := step.MatchesExpectedContent(b)
if err != nil { if err != nil {
t.Fatalf("Error compiling regex for step '%s': %v", step.Input, err) t.Fatalf("Error compiling regex for step '%s': %v", step.Input, err)
@ -338,6 +339,7 @@ func TestMyAccount_MyAddress(t *testing.T) {
publicKey := extractPublicKey(b) publicKey := extractPublicKey(b)
expectedContent := bytes.Replace([]byte(step.ExpectedContent), []byte("{public_key}"), []byte(publicKey), -1) expectedContent := bytes.Replace([]byte(step.ExpectedContent), []byte("{public_key}"), []byte(publicKey), -1)
step.ExpectedContent = string(expectedContent)
match, err := step.MatchesExpectedContent(b) match, err := step.MatchesExpectedContent(b)
if err != nil { if err != nil {
t.Fatalf("Error compiling regex for step '%s': %v", step.Input, err) t.Fatalf("Error compiling regex for step '%s': %v", step.Input, err)