<commit_before>import pytest

from . import testUtil as ipwbTest
from ipwb import replay
from time import sleep

import requests

import urllib

# Successful retrieval
# Accurate retrieval
# Comprehensive retrieval of sub-resources


@pytest.mark.parametrize("warc,lookup,has_md_header", [
    ('HTTP404.warc', 'memento/20200202100000/memento.us/', True),
    ('HTTP404.warc', 'memento/20200202100000/memento.ca/', False)])
def test_replay_404(warc, lookup, has_md_header):
    ipwbTest.startReplay(warc)

    resp = requests.get(f'http://localhost:5000/{lookup}',
                        allow_redirects=False)
<commit_msg>Add test of 404 returned from replay<commit_after>import pytest

from . import testUtil as ipwbTest
from ipwb import replay
from time import sleep

import requests

import urllib

# Successful retrieval
# Accurate retrieval
# Comprehensive retrieval of sub-resources


@pytest.mark.parametrize("warc,lookup,has_md_header", [
    ('HTTP404.warc', 'memento/20200202100000/memento.us/', True),
    ('HTTP404.warc', 'memento/20200202100000/memento.ca/', False),
    ('HTTP404.warc', 'loremipsum', False)])
def test_replay_404(warc, lookup, has_md_header):
    ipwbTest.startReplay(warc)

    resp = requests.get(f'http://localhost:5000/{lookup}',
                        allow_redirects=False)

{'fraction_non_alphanumeric': 0.1141552511415525, 'fraction_numerical': 0.0669710806697108, 'mean_word_length': 4.411522633744856, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1639063', 'n_tokens_mistral': 520, 'n_tokens_neox': 443, 'n_words': 93}