Update test_1.py
This commit is contained in:
parent
e56ece3dc9
commit
f9ae8ada70
@ -34,13 +34,13 @@ def test_near():
|
|||||||
assert "2010" in archive_near_year
|
assert "2010" in archive_near_year
|
||||||
|
|
||||||
archive_near_month_year = waybackpy.near(url, year=2015, month=2, UA=user_agent)
|
archive_near_month_year = waybackpy.near(url, year=2015, month=2, UA=user_agent)
|
||||||
assert "201502" in archive_near_month_year
|
assert ("201502" in archive_near_month_year) or ("201501" in archive_near_month_year) or ("201503" in archive_near_month_year)
|
||||||
|
|
||||||
archive_near_day_month_year = waybackpy.near(url, year=2006, month=11, day=15, UA=user_agent)
|
archive_near_day_month_year = waybackpy.near(url, year=2006, month=11, day=15, UA=user_agent)
|
||||||
assert "20061115" in archive_near_day_month_year
|
assert ("20061114" in archive_near_day_month_year) or ("20061115" in archive_near_day_month_year) or ("2006116" in archive_near_day_month_year)
|
||||||
|
|
||||||
archive_near_hour_day_month_year = waybackpy.near("www.python.org", year=2008, month=5, day=9, hour=15, UA=user_agent)
|
archive_near_hour_day_month_year = waybackpy.near("www.python.org", year=2008, month=5, day=9, hour=15, UA=user_agent)
|
||||||
assert "2008050915" in archive_near_hour_day_month_year
|
assert ("2008050915" in archive_near_hour_day_month_year) or ("2008050914" in archive_near_hour_day_month_year) or ("2008050913" in archive_near_hour_day_month_year)
|
||||||
|
|
||||||
def test_oldest():
|
def test_oldest():
|
||||||
url = "github.com/akamhy/waybackpy"
|
url = "github.com/akamhy/waybackpy"
|
||||||
@ -56,3 +56,15 @@ def test_get():
|
|||||||
oldest_google_archive = waybackpy.oldest("google.com", UA=user_agent)
|
oldest_google_archive = waybackpy.oldest("google.com", UA=user_agent)
|
||||||
oldest_google_page_text = waybackpy.get(oldest_google_archive, UA=user_agent)
|
oldest_google_page_text = waybackpy.get(oldest_google_archive, UA=user_agent)
|
||||||
assert "Welcome to Google" in oldest_google_page_text
|
assert "Welcome to Google" in oldest_google_page_text
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
test_get()
|
||||||
|
print(".")
|
||||||
|
test_near()
|
||||||
|
print(".")
|
||||||
|
test_newest()
|
||||||
|
print(".")
|
||||||
|
test_save()
|
||||||
|
print(".")
|
||||||
|
test_oldest()
|
||||||
|
print(".")
|
||||||
|
Loading…
Reference in New Issue
Block a user