"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/test_googler.py" between
googler-4.2.tar.gz and googler-4.3.1.tar.gz

About: googler is a command line tool to search Google (Web & News) from the terminal (requires Python).

test_googler.py  (googler-4.2):test_googler.py  (googler-4.3.1)
skipping to change at line 83 skipping to change at line 83
return result["url"].startswith("https://en.wikipedia.org") return result["url"].startswith("https://en.wikipedia.org")
GR(["--site=en.wikipedia.org", "google"]).all_should(be_from_wikipedia) GR(["--site=en.wikipedia.org", "google"]).all_should(be_from_wikipedia)
GR(["site:en.wikipedia.org google"]).all_should(be_from_wikipedia) GR(["site:en.wikipedia.org google"]).all_should(be_from_wikipedia)
@pytest.mark.parametrize("tld", ["in", "de"]) @pytest.mark.parametrize("tld", ["in", "de"])
def test_tld_option(tld): def test_tld_option(tld):
# Just a lame test to make sure there are results. # Just a lame test to make sure there are results.
GR(["--tld", tld, "google"]) GR(["--tld", tld, "google"])
def test_lang_option():
def have_louvre_museum_in_english(result):
return "Louvre Museum" in result["title"]
def have_louvre_museum_in_french(result):
return "Musée du Louvre" in result["title"]
GR(["--lang=en", "louvre"]).some_should(have_louvre_museum_in_english)
GR(["--lang=fr", "louvre"]).some_should(have_louvre_museum_in_french)
def test_exact_option(): def test_exact_option():
def have_gogole_in_title_or_abstract(result): def have_gogole_in_title_or_abstract(result):
return ( return (
"gogole" in result["title"].lower() "gogole" in result["title"].lower()
or "gogole" in result["abstract"].lower() or "gogole" in result["abstract"].lower()
) )
gr = GR(["--exact", "gogole"]) gr = GR(["--exact", "gogole"])
gr.some_should(have_gogole_in_title_or_abstract) gr.some_should(have_gogole_in_title_or_abstract)
 End of changes. 1 change blocks. 
10 lines changed or deleted 0 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)