Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
del: delete unrelated test
Browse files Browse the repository at this point in the history
  • Loading branch information
ozline committed Sep 6, 2023
1 parent 1d91e89 commit 5fee908
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 71 deletions.
46 changes: 0 additions & 46 deletions test/interaction/comment_action_test.go
Original file line number Diff line number Diff line change
@@ -1,57 +1,11 @@
package main

import (
"context"
"testing"

"bou.ke/monkey"
"github.com/ozline/tiktok/cmd/interaction/rpc"
"github.com/ozline/tiktok/kitex_gen/interaction"
"github.com/ozline/tiktok/kitex_gen/user"
)

func testCommentAction(t *testing.T) {
monkey.Patch(rpc.UserInfo, func(ctx context.Context, req *user.InfoRequest) (*user.User, error) {
return &user.User{Id: userId}, nil
})

defer monkey.UnpatchAll()
_, err := interactionService.MatchSensitiveWords(commentText)
if err != nil {
t.Logf("err: [%v] \n", err)
t.Error(err)
t.Fail()
}

req := &interaction.CommentActionRequest{
VideoId: videoId,
CommentText: &commentText,
CommentId: &commentId,
Token: token,
}

resp, err := interactionService.CreateComment(req, userId)

if err != nil {
t.Logf("err: [%v] \n", err)
t.Error(err)
t.Fail()
return
}

commentId = resp.Id
t.Logf("commentId: [%v] \n", commentId)

_, err = interactionService.DeleteComment(req, userId)

if err != nil {
t.Logf("err: [%v] \n", err)
t.Error(err)
t.Fail()
}
t.Log("------------testCommentAction success---------------")
}

func benchmarkCommentAction(b *testing.B) {
req := &interaction.CommentActionRequest{
VideoId: videoId,
Expand Down
21 changes: 0 additions & 21 deletions test/interaction/favorite_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,6 @@ import (
"github.com/ozline/tiktok/kitex_gen/interaction"
)

func testFavoriteAction(t *testing.T) {
req := &interaction.FavoriteActionRequest{
VideoId: videoId,
Token: token,
}

err := interactionService.Like(req, userId)
if err != nil {
t.Logf("err: [%v] \n", err)
t.Error(err)
t.Fail()
}

err = interactionService.Dislike(req, userId)
if err != nil {
t.Logf("err: [%v] \n", err)
t.Error(err)
t.Fail()
}
}

func benchmarkFavoriteAction(b *testing.B) {
req := &interaction.FavoriteActionRequest{
VideoId: videoId,
Expand Down
4 changes: 0 additions & 4 deletions test/interaction/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ func TestMain(m *testing.M) {
}

func TestMainOrder(t *testing.T) {
t.Run("comment action", testCommentAction)

t.Run("comment list", testCommentList)

t.Run("comment count", testCommentCount)

t.Run("favorite action", testFavoriteAction)

t.Run("favorite count", testVideoFavoriteCount)

t.Run("user favorite count", testUserFavoriteCount)
Expand Down

0 comments on commit 5fee908

Please sign in to comment.