From a98a206dd2e5c99d63896d505b8c6af4fc18350d Mon Sep 17 00:00:00 2001 From: Jacob Hoffman-Andrews Date: Fri, 5 Jan 2018 12:07:12 -0800 Subject: [PATCH] Remove references to test-ca.pem. (#3322) shell_test.go and publisher_test.go had unnecessary references to ../test/test-ca.pem. This change makes them a little more self-contained. Note: ca/ca_test.go still depends on test-ca.pem, but removing the dependency turns out to be a little more complicated due to hardcoded expectations in some of the test cases. --- cmd/shell_test.go | 6 +++--- publisher/publisher_test.go | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/shell_test.go b/cmd/shell_test.go index 09d5540ff..d0b27c822 100644 --- a/cmd/shell_test.go +++ b/cmd/shell_test.go @@ -145,7 +145,7 @@ func TestLoadCert(t *testing.T) { "open ../does/not/exist: no such file or directory", }, { - "../test/test-ca.key", + "./testdata/key.pem", "Invalid certificate value returned", }, } @@ -156,8 +156,8 @@ func TestLoadCert(t *testing.T) { test.AssertEquals(t, err.Error(), tc.expectedErr) } - bytes, err := LoadCert("../test/test-ca.pem") - test.AssertNotError(t, err, "LoadCert(../test/test-ca.pem) errored") + bytes, err := LoadCert("./testdata/cert.pem") + test.AssertNotError(t, err, "LoadCert(\"./testdata/cert.pem\") errored") test.AssertNotEquals(t, len(bytes), 0) } diff --git a/publisher/publisher_test.go b/publisher/publisher_test.go index ca044ea18..4972224a7 100644 --- a/publisher/publisher_test.go +++ b/publisher/publisher_test.go @@ -115,8 +115,6 @@ CspkK71IGqM9UwwMtCZBp0fK/Xv9o1d85paXcJ/aH8zg6EK4UkuXDFnLsg1LrIru OY8B7wwvZTLzU6WWs781TJXx2CE04PneeeArLpVLkiGIWjk= -----END CERTIFICATE-----` -const issuerPath = "../test/test-ca.pem" - var log = blog.UseMock() var ctx = context.Background()