Пример #1
0
def test_citation_report():
    with open('test.json') as f:
        expectedResult = json.load(f)
    get_citations_needed_report("https://en.wikipedia.org/wiki/Mindset")
    with open('data.json') as f:
        actualResult = json.load(f)
    assert actualResult == expectedResult
Пример #2
0
def test_report():
    assert get_citations_needed_report(
        'https://en.wikipedia.org/wiki/Automation'
    )[0] == "The costs of automation to the environment are different depending on the technology, product or engine automated. There are automated engines that consume more energy resources from the Earth in comparison with previous engines and vice versa"
    assert get_citations_needed_report(
        'https://en.wikipedia.org/wiki/Automation'
    )[1] == "Hazardous operations, such as oil refining, the manufacturing of industrial chemicals, and all forms of metal working, were always early contenders for automation [dubious  – discuss]"
    assert get_citations_needed_report(
        'https://en.wikipedia.org/wiki/Automation'
    )[2] == "Online shopping could be considered a form of automated retail as the payment and checkout are through an automated Online transaction processing system, with the share of online retail accounting jumping from 5.1% in 2011 to 8.3% in 2016"
Пример #3
0
def test_report():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    actual = get_citations_needed_report(URL)
    expected = '''the the paragraphs are :

 The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region.[citation needed][7] Such conditions encouraged the initial pursuit of a hunter-gatherer existence.

The Mexica people arrived in the Valley of Mexico in 1248 AD. They had migrated from the deserts north of the Rio Grande[citation needed] over a period traditionally said to have been 100 years. They may have thought of themselves as the heirs to the prestigious civilizations that had preceded them.[citation needed] What the Aztec initially lacked in political power, they made up for with ambition and military skill. In 1325, they established the biggest city in the world at that time, Tenochtitlan.

The Mexica people arrived in the Valley of Mexico in 1248 AD. They had migrated from the deserts north of the Rio Grande[citation needed] over a period traditionally said to have been 100 years. They may have thought of themselves as the heirs to the prestigious civilizations that had preceded them.[citation needed] What the Aztec initially lacked in political power, they made up for with ambition and military skill. In 1325, they established the biggest city in the world at that time, Tenochtitlan.

The Spanish had no intention to turn over Tenochtitlan to the Tlaxcalteca. While Tlaxcalteca troops continued to help the Spaniards, and Tlaxcala received better treatment than other indigenous nations, the Spanish eventually disowned the treaty. Forty years after the conquest, the Tlaxcalteca had to pay the same tax as any other indigenous community.[citation needed]

During the three centuries of colonial rule, fewer than 700,000 Spaniards, most of them men, settled in Mexico.[citation needed] Europeans, Africans, and indigenous intermixed, creating a mixed-race casta population in a process known as mestizaje. Mestizos, people of mixed European-indigenous ancestry, constitute the majority of Mexico's population. 

 and the lines are 

) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region.

The Mexica people arrived in the Valley of Mexico in 1248 AD. They had migrated from the deserts north of the Rio Grande

over a period traditionally said to have been 100 years. They may have thought of themselves as the heirs to the prestigious civilizations that had preceded them.

The Spanish had no intention to turn over Tenochtitlan to the Tlaxcalteca. While Tlaxcalteca troops continued to help the Spaniards, and Tlaxcala received better treatment than other indigenous nations, the Spanish eventually disowned the treaty. Forty years after the conquest, the Tlaxcalteca had to pay the same tax as any other indigenous community.

During the three centuries of colonial rule, fewer than 700,000 Spaniards, most of them men, settled in Mexico. '''
    assert actual == expected
Пример #4
0
def test_citations_text_report():
    actual = get_citations_needed_report(
        'https://en.wikipedia.org/wiki/The_Grudge')
    expected = """In late 2002, the unexpected success of the English-language remake of The Ring finally gave Sony Pictures confidence to green-light an English-language remake of Ju-On: The Grudge. That same day, Takashi Shimizu, the director and creator of the original film, was hired to direct the film, with Stephen Susco writing the screenplay, and Sam Raimi through its Ghost House Pictures banner producing the project, alongside Robert Tapert and Takashige Ichise. Shimizu was eager to work on a remake of his own film, as he saw it as an opportunity to improve and fix some of the perceived problems and flaws that were present in the original film.[citation needed]

The Grudge was released on VHS, DVD, and UMD on February 1, 2005, as a standard version of the film with only a few special features.[12] On May 17, 2005, the unrated director's cut of The Grudge was released on DVD in North America. The release included several scenes that were cut to achieve a lower rating from the MPAA.[citation needed] This version of the film was used as the theatrical run in Japan. The release also contained new deleted scenes and commentaries, director Takashi Shimizu's original Ju-On short films, Katasumi and 4444444444, and more.[13] The film was released on Blu-ray Disc in the US on May 12, 2009, the same day that The Grudge 3 was released on DVD. It was made available to purchase on iTunes in 2008.[citation needed]

The Grudge was released on VHS, DVD, and UMD on February 1, 2005, as a standard version of the film with only a few special features.[12] On May 17, 2005, the unrated director's cut of The Grudge was released on DVD in North America. The release included several scenes that were cut to achieve a lower rating from the MPAA.[citation needed] This version of the film was used as the theatrical run in Japan. The release also contained new deleted scenes and commentaries, director Takashi Shimizu's original Ju-On short films, Katasumi and 4444444444, and more.[13] The film was released on Blu-ray Disc in the US on May 12, 2009, the same day that The Grudge 3 was released on DVD. It was made available to purchase on iTunes in 2008.[citation needed]"""
    assert actual == expected
Пример #5
0
def test_5():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    li1 = get_citations_needed_report(URL)
    li2 = []
    for i in range(len(li1)):
        y = li1[i].split('[')[0]
        li2.append(y)

    actual = li2[-1]
    expected = "During the three centuries of colonial rule, fewer than 700,000 Spaniards, most of them men, settled in Mexico."
    assert actual == expected
Пример #6
0
def test_4():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    li1 = get_citations_needed_report(URL)
    li2 = []
    for i in range(len(li1)):
        y = li1[i].split('[')[0]
        li2.append(y)

    actual = li2[0]
    expected = "The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region."
    assert actual == expected
Пример #7
0
def test_3():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    li1 = get_citations_needed_report(URL)
    actual = li1[0]
    expected = "The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region.[citation needed][7] Such conditions encouraged the initial pursuit of a hunter-gatherer existence.\n"
    assert actual == expected
Пример #8
0
 def test_citations_report(self, url, report):
     """Test if the function returns correct citation report
     """
     assert get_citations_needed_report(url) == report
Пример #9
0
def test_get_report_of_citation_needed():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    li1 = get_citations_needed_report(URL)
    assert "The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region.[citation needed][7] Such conditions encouraged the initial pursuit of a hunter-gatherer existence.\n"
    assert "The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region."
    assert "During the three centuries of colonial rule, fewer than 700,000 Spaniards, most of them men, settled in Mexico."
Пример #10
0
def test_general_that_requires_citation_report():
    URL = "https://en.wikipedia.org/wiki/Awara_Zindagi"
    actual = get_citations_needed_report(URL)
    expect = "Article requires citation"
    assert actual == expect
Пример #11
0
def test_get_citations_needed_report():
    text = get_citations_needed_report('https://en.wikipedia.org/wiki/Stock_market')
    actual = text.count('[citation needed]')
    expected = 5
    assert actual == expected
Пример #12
0
def test_citation_report():
    actual = get_citations_needed_report(
        'https://en.wikipedia.org/wiki/2020_Nagorno-Karabakh_war')
    expected = 'The accounts of engagements in this conflict rely primarily on official statements from belligerents.[citation needed] The engagements have been characterized by the use of armoured warfare; drone warfare,[160] especially the use of Turkish-made Bayraktar TB2 and Israeli loitering munition Harop drones;[94][92] heavy artillery; rocket attacks; and trench warfare.[161] Throughout the campaign, Azerbaijan has relied heavily on drones to strike at Armenian/Artsakh forces, and managed to inflict heavy losses. Having successfully targeted tanks, artillery, and air defense systems, Azerbaijani drones also began targeting units of soldiers. However, some Azerbaijani drones were shot down.[162][163] It has also featured the deployment of cluster munitions, which are banned by the majority of the international community but not by Armenia or Azerbaijan:[164] international third parties have confirmed that Armenia had deployed cluster munitions on civilian-populated areas outside of the conflict zone,[165] and international third parties have confirmed evidence of Azerbaijan\'s use of cluster munitions against civilian areas of Nagorno-Karabakh.[166][167] A series of attacks have inflicted mass civilian casualties in Ganja, Azerbaijan, while civilian residences and infrastructure in Stepanakert, Artsakh\'s capital, and elsewhere have been targeted, inflicting casualties and causing extensive damage.[168] Disinformation and misinformation have accompanied the conflict.[169]\n\nAfter the shelling of Khojavend (Martuni),[178] Artsakh authorities began mobilizing civilians.[179] Just before 04:00 (00:00 UTC) on 10 October 2020, Russia reported that both Armenia and Azerbaijan had agreed on a humanitarian ceasefire after ten hours of talks in Moscow (the Moscow Statement) and announced that both would enter "substantive" talks.[citation needed] After the declared ceasefire, the President of Artsakh admitted Azerbaijan had been able to achieve some success, moving the front deep into Artsakh territory;[180] the Armenian Prime Minister announced that Armenian forces had conducted a "partial retreat".[181]'
    assert actual == expected
Пример #13
0
def test_one_citation():
    url = 'https://en.wikipedia.org/wiki/History_of_Mexico'
    actual = get_citations_needed_report(url)
    expected = 'There are 5 needed citations for this wiki page'
    assert actual == expected
Пример #14
0
def test_report():
    URL = "https://en.wikipedia.org/wiki/History_of_Mexico"
    actual = get_citations_needed_report(URL)
    expect = "---- Citations need report ----\n1: Main articles: New Spain and Spanish Empire\n"
    assert actual == expect
Пример #15
0
def test_general_that_requires_citation_report():
    URL = "https://en.wikipedia.org/wiki/Cardiff_Marriott_Hotel"
    actual = get_citations_needed_report(URL)
    expect = "Article does not require citation"
    assert actual == expect
Пример #16
0
def test_get_report_of_citation_needed():
    get_citations_needed_report(url)
    assert "The first people to settle in Mexico encountered a climate far milder than the current one. In particular, the Valley of Mexico contained several large paleo-lakes (known collectively as Lake Texcoco) surrounded by dense forest. Deer were found in this area, but most fauna were small land animals and fish and other lacustrine animals were found in the lake region.[citation needed][7] Such conditions encouraged the initial pursuit of a hunter-gatherer existence.\n" 
Пример #17
0
 def test_citations_report(self, url, report):
     assert get_citations_needed_report(url) == report
Пример #18
0
def test_citations():
    URL = 'https://en.wikipedia.org/wiki/Gun' 
    actuall = ['In contemporary military and naval parlance the term gun has a very specific meaning and refers solely to any large-calibre, direct-fire, high-velocity, flat-trajectory artillery piece employing an explosive-filled hollowed metal shell or solid bolt as its primary projectile.[citation needed] This later usage contrasts with large-calibre, high-angle, low-velocity, indirect-fire weapons such as howitzers, mortars, and grenade launchers which invariantly employ explosive-filled shells. In other military use, the term "gun" refers primarily to direct fire weapons that capitalize on their muzzle velocity for penetration or range. In modern parlance, these weapons are breech-loaded and built primarily for long range fire with a low or almost flat ballistic arc. A variation is the howitzer or gun-howitzer designed to offer the ability to fire both low or high-angle ballistic arcs. In this use, example guns include naval guns. A less strict application of the word is to identify one artillery weapon system or non-machine gun projectile armament on aircraft.[citation needed]\n', 'A related military use of the word is in describing gun-type fission weapon. In this instance, the "gun" is part of a nuclear weapon and contains an explosively propelled sub-critical slug of fissile material within a barrel to be fired into a second sub-critical mass in order to initiate the fission reaction. Potentially confused with this usage are small nuclear devices capable of being fired by artillery or recoilless rifle.[citation needed]\n', 'Shotguns are normally civilian weapons used primarily for hunting. These weapons are typically smooth bored and fire a shell containing small lead or steel balls. Variations use rifled barrels or fire other projectiles including solid lead slugs, a Taser XREP projectile capable of stunning a target, or other payloads. In military versions, these weapons are often used to burst door hinges or locks in addition to antipersonnel uses.[citation needed]\n']
    expected = get_citations_needed_report(URL)
    assert actuall==expected