Skip to content

Commit 6e29be5

Browse files
committed
Fix test
1 parent 2d515f3 commit 6e29be5

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

rest/diagnostic_doc_api_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ func TestGetAlldocChannels(t *testing.T) {
6363
}
6464

6565
func TestGetDocDryRuns(t *testing.T) {
66+
if !base.UnitTestUrlIsWalrus() {
67+
t.Skip("This test asserts on an error message that will not be the same without walrus")
68+
}
6669
rt := NewRestTester(t, &RestTesterConfig{PersistentConfig: true})
6770
defer rt.Close()
6871
bucket := rt.Bucket().GetName()
@@ -103,12 +106,12 @@ func TestGetDocDryRuns(t *testing.T) {
103106
assert.NoError(t, err)
104107
assert.Equal(t, respMap.Exception, "403 user num too low")
105108

106-
response = rt.SendDiagnosticRequest("GET", fmt.Sprintf("/{{.keyspace}}/_sync?doc_id=doc"), `{"user":{"num":150}, "channel":{num:88}}`)
109+
response = rt.SendDiagnosticRequest("GET", fmt.Sprintf("/{{.keyspace}}/_sync?doc_id=doc"), `{"user":{"num":150}, "channel":"abc"}`)
107110
RequireStatus(t, response, http.StatusOK)
108-
109-
err = json.Unmarshal(response.BodyBytes(), &respMap)
111+
var newrespMap SyncFnDryRun
112+
err = json.Unmarshal(response.BodyBytes(), &newrespMap)
110113
assert.NoError(t, err)
111-
assert.Equal(t, respMap.Exception, "TypeError: Cannot access member '0' of undefined")
114+
assert.Equal(t, newrespMap.Exception, "TypeError: Cannot access member '0' of undefined")
112115

113116
response = rt.SendDiagnosticRequest("GET", fmt.Sprintf("/{{.keyspace}}/_sync?doc_id=doc"), `{"user":{"num":120, "name":["user2"]}, "channel":"channel2"}`)
114117
RequireStatus(t, response, http.StatusOK)

0 commit comments

Comments
 (0)