Skip to content

Commit

Permalink
rule test for multi-identical-reply
Browse files Browse the repository at this point in the history
  • Loading branch information
bnewbold committed Dec 9, 2023
1 parent 5711e36 commit ccf1dbe
Show file tree
Hide file tree
Showing 2 changed files with 551 additions and 0 deletions.
29 changes: 29 additions & 0 deletions automod/rules/replies_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package rules

import (
"context"
"testing"

"github.com/bluesky-social/indigo/automod"

"github.com/stretchr/testify/assert"
)

func TestIdenticalReplyPostRule(t *testing.T) {
assert := assert.New(t)
ctx := context.Background()

engine := automod.EngineTestFixture()
engine.Rules = automod.RuleSet{
PostRules: []automod.PostRuleFunc{
IdenticalReplyPostRule,
},
}

capture := automod.MustLoadCapture("testdata/capture_hackerdarkweb.json")
did := capture.AccountMeta.Identity.DID.String()
assert.NoError(automod.ProcessCaptureRules(&engine, capture))
f, err := engine.Flags.Get(ctx, did)
assert.NoError(err)
assert.Equal([]string{"multi-identical-reply"}, f)
}
Loading

0 comments on commit ccf1dbe

Please sign in to comment.