aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Burke <kev@inburke.com>2017-07-17 12:05:22 -0700
committerKevin Burke <kev@inburke.com>2017-10-06 14:39:39 +0000
commitc4baf783371a7c2b30b95ab528a38f6b12e7b6c1 (patch)
tree3f94d7ee2cabb0c8dcce03970ea96daa62d3c6a0
parent0eaa382942a3219dcdf0eb1a5e6a72854ebf7dcd (diff)
downloadgo-x-review-c4baf783371a7c2b30b95ab528a38f6b12e7b6c1.tar.xz
git-codereview: specify a dummy cookie file
This test was incorrectly passing when it should be dying, because I have a global http.cookiefile defined that this test falls back to using if a local http.cookiefile isn't configured. Fix this by defining a local, invalid cookiefile, which causes git/git-codereview to error out. Change-Id: Ia538d3e8af53b849d672419582c21ba8a6fdbbdd Reviewed-on: https://go-review.googlesource.com/49293 Reviewed-by: Andrew Bonventre <andybons@golang.org>
-rw-r--r--git-codereview/api_test.go16
1 files changed, 12 insertions, 4 deletions
diff --git a/git-codereview/api_test.go b/git-codereview/api_test.go
index 41c599f..02132a2 100644
--- a/git-codereview/api_test.go
+++ b/git-codereview/api_test.go
@@ -20,12 +20,20 @@ var authTests = []struct {
died bool
}{
{
- died: true,
+ // If we specify the empty string here, git will store an empty
+ // value for the local http.cookiefile, and fall back to the global
+ // http.cookiefile, which will fail this test on any machine that has
+ // a global http.cookiefile configured. If we write a local, invalid
+ // value, git will try to load the local cookie file (and then fail
+ // later).
+ cookiefile: " ",
+ died: true,
},
{
- netrc: "machine go.googlesource.com login u1 password pw\n",
- user: "u1",
- password: "pw",
+ netrc: "machine go.googlesource.com login u1 password pw\n",
+ cookiefile: " ", // prevent global fallback
+ user: "u1",
+ password: "pw",
},
{
cookiefile: "go.googlesource.com TRUE / TRUE 2147483647 o2 git-u2=pw\n",