Пример #1
0
def test_get_citations_needed_report_usa_last_200():
    usa = wiki_page_parse('https://en.wikipedia.org/wiki/United_States')
    actual = usa.get_citations_needed_report()
    expected = '''the disease has affected over 3 million Americans and killed over 130,000 people.[citation needed] The United States is, by far, the country with the most cases of COVID-19 as of June 10, 2020.[195]

'''
    assert actual[-200:] == expected
Пример #2
0
def test_check_wiki_article_true():
    invalid_search = wiki_page_parse(
        'https://en.wikipedia.org/wiki/Costa_Rica')
    assert invalid_search.check_for_wiki_article() == True
Пример #3
0
def test_check_wiki_article_false():
    invalid_search = wiki_page_parse(
        'https://en.wikipedia.org/wiki/Cxvxczdfaff')
    assert invalid_search.check_for_wiki_article() == False
Пример #4
0
def test_get_citations_needed_report_usa_first_100():
    usa = wiki_page_parse('https://en.wikipedia.org/wiki/United_States')
    actual = usa.get_citations_needed_report()
    expected = 'After World War II, the United States and the Soviet Union competed for power, influence, and presti'
    assert actual[:100] == expected
Пример #5
0
def test_get_citations_needed_report_wa_first_30():
    wa = wiki_page_parse('https://en.wikipedia.org/wiki/Washington_(state)')
    actual = wa.get_citations_needed_report()
    expected = 'Confusion over the state of Wa'
    assert actual[:30] == expected
Пример #6
0
def test_get_citations_needed_report_wa():
    wa = wiki_page_parse('https://en.wikipedia.org/wiki/Washington_(state)')
    assert wa.get_citations_needed_report() == wa_text
Пример #7
0
def test_get_citations_needed_count_kc():
    kc = wiki_page_parse(
        'https://en.wikipedia.org/wiki/King_County,_Washington')
    assert kc.get_citations_needed_count() == 2
Пример #8
0
def test_get_citations_needed_count_usa():
    usa = wiki_page_parse('https://en.wikipedia.org/wiki/United_States')
    assert usa.get_citations_needed_count() == 5