Exemple #1
0
 def test_basic(self):
     url = "dol.gov"
     snapshots = waybackpack.search(url)
     first = waybackpack.Asset(snapshots[0])
     content = first.fetch()
     assert (b"Regulatory Information" in content)
     assert (len(content) > 0)
Exemple #2
0
 def test_basic(self):
     url = "dol.gov"
     snapshots = waybackpack.search(url)
     timestamps = [snap["timestamp"] for snap in snapshots]
     first = waybackpack.Asset(url, timestamps[0])
     content = first.fetch()
     assert (b"Regulatory Information" in content)
     assert (len(content) > 0)
Exemple #3
0
    def test_503(self):
        asset = waybackpack.Asset(
            "https://www.amazon.com/Art-Gathering-How-Meet-Matters/dp/1594634920",
            timestamp=20190506092829,
        )

        content = asset.fetch()
        assert (content is None)
Exemple #4
0
 def test_basic(self):
     url = "http://www.dol.gov/"
     snapshots = waybackpack.search(url)
     timestamps = [snap["timestamp"] for snap in snapshots]
     first = waybackpack.Asset(url, timestamps[0])
     session = waybackpack.Session(follow_redirects=True)
     content = first.fetch(session=session)
     assert (b"Regulatory Information" in content)
     assert (len(content) > 0)
Exemple #5
0
 def test_no_redirect(self):
     asset = waybackpack.Asset(URL, TIMESTAMP)
     content = asset.fetch()
     assert(b"Impatient" in content)
Exemple #6
0
 def test_yes_redirect(self):
     session = waybackpack.Session(follow_redirects=True)
     asset = waybackpack.Asset(URL, TIMESTAMP)
     content = asset.fetch(session=session)
     assert(b"Impatient" not in content)
     assert(b"Nobody who works 40 hours" in content)
 def test_no_redirect(self):
     asset = waybackpack.Asset(URL, TIMESTAMP)
     content = asset.fetch()
     assert (len(content) == 0)
Exemple #8
0
 def test_no_redirect(self):
     asset = waybackpack.Asset(SNAPSHOT)
     content = asset.fetch()
     assert(b"Impatient" in content)