From 2ae3a80997c78fef59206d734f87210ca87b15f3 Mon Sep 17 00:00:00 2001 From: Ollivier Robert Date: Thu, 15 Apr 2021 15:02:52 +0200 Subject: [PATCH] Fix tests to use data from Conversation, not Timelines. --- status_test.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/status_test.go b/status_test.go index 929578b..9b8616c 100644 --- a/status_test.go +++ b/status_test.go @@ -372,7 +372,7 @@ func TestGetTimelinePublic(t *testing.T) { func TestGetTimelineDirect(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - fmt.Fprintln(w, `[{"content": "direct"}, {"content": "status"}]`) + fmt.Fprintln(w, `[{"id": "4", "unread":false, "last_status" : {"content": "zzz"}}, {"id": "3", "unread":true, "last_status" : {"content": "bar"}}]`) })) defer ts.Close() @@ -381,13 +381,14 @@ func TestGetTimelineDirect(t *testing.T) { if err != nil { t.Fatalf("should not be fail: %v", err) } + t.Logf("%#v", tl) if len(tl) != 2 { t.Fatalf("result should be two: %d", len(tl)) } - if tl[0].Content != "direct" { + if tl[0].Content != "zzz" { t.Fatalf("want %q but %q", "foo", tl[0].Content) } - if tl[1].Content != "status" { + if tl[1].Content != "bar" { t.Fatalf("want %q but %q", "bar", tl[1].Content) } }