28 lines
931 B
Go
28 lines
931 B
Go
package sysin
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
)
|
|
|
|
func TestCultivateContentBatchReviewFilter(t *testing.T) {
|
|
in := &CultivateContentBatchReviewInp{ObjectType: "feed_post", Ids: []string{"123"}, Action: "take_down", Reason: "违规内容"}
|
|
if err := in.Filter(context.Background()); err != nil {
|
|
t.Fatalf("Filter returned error: %v", err)
|
|
}
|
|
}
|
|
|
|
func TestCultivateContentBatchReviewFilterRequiresReason(t *testing.T) {
|
|
in := &CultivateContentBatchReviewInp{ObjectType: "feed_post", Ids: []string{"123"}, Action: "reject"}
|
|
if err := in.Filter(context.Background()); err == nil {
|
|
t.Fatal("expected missing reason error")
|
|
}
|
|
}
|
|
|
|
func TestCultivateReportHandleFilterGovernanceRules(t *testing.T) {
|
|
in := &CultivateReportHandleInp{Id: "123", Action: "processing", UserAction: "freeze", Reason: "恶意行为"}
|
|
if err := in.Filter(context.Background()); err == nil {
|
|
t.Fatal("expected governance action to require resolve")
|
|
}
|
|
}
|