def test_prepare_songs_transform_words():
    """It should replace in' with ing."""
    raw_songs = [
        "I am runnin' and singin'",
        "She is runnin' all over the place",
        "runnin'\nall over the place",
        "She is runnin' and he is singin'",
        "I cannot listen to what they are singin'",
        "The island we are on is nice",
        "I ain't havin' this ain't",
        "Ain't!",
    ]
    songs = util.prepare_songs(raw_songs)
    assert songs[0] == "i am runnin' and singin'"
    assert songs[1] == "she is runnin' all over the place"
    assert songs[2] == "runnin' \n all over the place"

    songs = util.prepare_songs(raw_songs, transform_words=True)
    assert songs[0] == "i am running and singing"
    assert songs[1] == "she's running all over the place"
    assert songs[2] == "running \n all over the place"
    assert songs[3] == "she's running and he's singing"
    assert songs[4] == "i can't listen to what they're singing"
    assert songs[5] == "the island we're on is nice"
    assert songs[6] == "i ain't having this ain't"
    assert songs[7] == "ain't!"
Exemplo n.º 2
0
def test_prepare_songs_max_repeats(songs_raw):
    """It should strip newlines at beginning and end but preserve newlines in the middle."""
    songs = util.prepare_songs(["repeat\nrepeat\nrepeat"])
    assert songs[0] == "repeat \n repeat"

    songs = util.prepare_songs(
        ["once\n twice\nrepeat \n repeat\nrepeat \n and again\n and again\n and again"]
    )
    assert songs[0] == "once \n twice \n repeat \n repeat \n and again \n and again"
Exemplo n.º 3
0
def test_prepare_songs_transform_words():
    """It should replace in' with ing."""
    raw_songs = [
        "I am runnin' and singin'", "She is runnin' all over the place",
        "runnin'\nall over the place", "She is runnin' and he is singin'",
        "I cannot listen to what they are singin'",
        "The island we are on is nice", "I ain't havin' this ain't", "Ain't!"
    ]
    songs = util.prepare_songs(raw_songs)
    assert songs[0] == 'i am runnin\' and singin\''
    assert songs[1] == 'she is runnin\' all over the place'
    assert songs[2] == 'runnin\' \n all over the place'

    songs = util.prepare_songs(raw_songs, transform_words=True)
    assert songs[0] == 'i am running and singing'
    assert songs[1] == 'she\'s running all over the place'
    assert songs[2] == 'running \n all over the place'
    assert songs[3] == 'she\'s running and he\'s singing'
    assert songs[4] == 'i can\'t listen to what they\'re singing'
    assert songs[5] == 'the island we\'re on is nice'
    assert songs[6] == 'i ain\'t having this ain\'t'
    assert songs[7] == 'ain\'t!'
def test_prepare_songs(songs_raw):
    """It should strip newlines at beginning and end but preserve newlines in the middle."""
    songs = util.prepare_songs(songs_raw)
    assert songs[0] == "meow \n meow"
    assert songs[1] == "woof \n  \n chorus \n woof"
Exemplo n.º 5
0
def test_prepare_songs_profanity_censor():
    """It should remove profanity."""
    songs = util.prepare_songs(["ok shit go *"], profanity_censor=True)
    assert songs[0] == "ok **** go"