예제 #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