Пример #1
0
def test_remove_currency_symbols():
    docx = TextCleaner()
    docx.text = "This is the mail [email protected] ,our WEBSITE is https://example.com 😊 and it will cost $100 to subscribe."
    result = docx.remove_currency_symbols()
    assert str(
        result
    ) == 'This is the mail [email protected] ,our WEBSITE is https://example.com 😊 and it will cost 100 to subscribe.'
Пример #2
0
def test_remove_dates():
    docx = TextCleaner()
    docx.text = "This is the mail [email protected] ,our WEBSITE is https://example.com 😊 and it will cost $100 to subscribe 20/12/2005."
    result = docx.remove_dates()
    assert str(
        result
    ) == "This is the mail [email protected] ,our WEBSITE is https://example.com 😊 and it will cost $100 to subscribe ."
Пример #3
0
def test_remove_emojis():
    docx = TextCleaner()
    docx.text = "This is the mail [email protected] ,our WEBSITE is https://example.com 😊."
    result = docx.remove_emojis()
    assert str(
        result
    ) == 'This is the mail [email protected] ,our WEBSITE is https://example.com .'
Пример #4
0
def test_multiple_methods_chaining():
    t1 = "This is the mail [email protected] ,our WEBSITE is https://example.com 😊 and it will cost $100 to subscribe."
    docx = TextCleaner(t1)
    result = docx.remove_emails().remove_urls().remove_emojis()
    assert str(
        result
    ) == 'This is the mail  ,our WEBSITE is   and it will cost $100 to subscribe.'