From 66cc94d31082c41624751495bdbb99877211d1e1 Mon Sep 17 00:00:00 2001 From: Ryan O'Hara-Reid Date: Mon, 3 Apr 2017 19:21:49 +1000 Subject: [PATCH] Added Confirm and Delete ECS tests. --- config/config_tests/config_encryption_test.go | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/config/config_tests/config_encryption_test.go b/config/config_tests/config_encryption_test.go index e51c1a87..338ddf88 100644 --- a/config/config_tests/config_encryption_test.go +++ b/config/config_tests/config_encryption_test.go @@ -66,7 +66,7 @@ func TestConfirmJson(t *testing.T) { if err != nil { t.Errorf("Test failed. TestConfirmJson: %s", err) } - err2 := config.ConfirmConfigJSON(testConfirmJson, result) + err2 := config.ConfirmConfigJSON(testConfirmJson, &result) if err2 != nil { t.Errorf("Test failed. TestConfirmJson: %s", err2) } @@ -74,3 +74,23 @@ func TestConfirmJson(t *testing.T) { t.Errorf("Test failed. TestConfirmJson: Error Unmarshalling JSON") } } + +func TestConfirmECS(t *testing.T) { + t.Parallel() + + ECStest := []byte("THORS-HAMMER") + if !config.ConfirmECS(ECStest) { + t.Errorf("Test failed. TestConfirmECS: Error finding ECS.") + } +} + +func TestRemoveECS(t *testing.T) { + t.Parallel() + + ECStest := []byte("THORS-HAMMER") + isremoved := config.RemoveECS(ECStest) + + if string(isremoved) != "" { + t.Errorf("Test failed. TestConfirmECS: Error ECS not deleted.") + } +}