lofibeats/test_youtube.py
2026-09-16 11:41:57 -07:00

30 lines
895 B
Python

import youtube
import pytest
import wordfilter
def test_wordfilter():
wfilter = wordfilter.Wordfilter()
wfilter.add_words({'FAKESLUR'})
for good in [
'hi',
'Nothing in this was made using AI',
'Nothing in this was made using artificial intelligence',
'This music comes from Japan',
'Homogenized beats are sick',
'I love ornithomorphs',
'Join us on this audio journey'
]:
assert youtube.check_text(good, wfilter)
for bad in [
'This music was made using AI',
'This video was generated using artificial intelligence technology',
'This is a FAKESLUR video',
'This is jap music',
'shut up homo',
'We present to you soothing music born from "SunoAI"',
'Check out this shit I made with udio'
]:
assert not youtube.check_text(bad, wfilter)