-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,6 +223,19 @@ type MLBanTests(fixture: VahterTestContainers, _unused: MlAwaitFixture) = | |
let! msgBanned = fixture.MessageBanned spam.Message | ||
Assert.False msgBanned | ||
} | ||
|
||
[<Fact>] | ||
let ``Message with spam in photo caption also triggers auto-delete`` () = task { | ||
// record a message, where 2 is in a training set as spam word | ||
// but text is in a message.Caption | ||
// ChatsToMonitor[0] doesn't have stopwords | ||
let msgUpdate = Tg.quickMsg(chat = fixture.ChatsToMonitor[0], text = null, caption = "2") | ||
let! _ = fixture.SendMessage msgUpdate | ||
|
||
// assert that the message got auto banned | ||
let! msgBanned = fixture.MessageIsAutoDeleted msgUpdate.Message | ||
Assert.True msgBanned | ||
Check failure on line 237 in src/VahterBanBot.Tests/MLBanTests.fs GitHub Actions / Test resultsVahterBanBot.Tests.MLBanTests+MLBanTests ► Message with spam in photo caption also triggers auto-delete
Raw output
|
||
} | ||
|
||
interface IAssemblyFixture<VahterTestContainers> | ||
interface IClassFixture<MlAwaitFixture> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters