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>
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 @@
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",