<commit_before>import datetime as dt

from flask_application import app


def test_daily_westminster_pages_exist():
    start_date = dt.date(2015, 01, 01)

    with app.test_client() as c:
        for days in range(365):
            date = start_date + dt.timedelta(days=days)
            month, day = date.month, date.day
            response = c.get('/{month:02d}/{day:02d}/'.format(month=month, day=day))
            assert response.status_code == 200

            response = c.get('/{month:02d}/{day:02d}'.format(month=month, day=day),
                             follow_redirects=True)
            assert response.status_code == 200


def test_chief_end_of_man():
    with app.test_client() as c:
        response = c.get('/01/01/')
        assert "chief end of man" in response.data
        response = c.get('/01/02/')
        assert "better preserving and propagating" in response.data


def test_daily_westminster_bad_days():
    with app.test_client() as c:
        response = c.get('/1/1/')
        assert response.status_code == 404
        response = c.get('/1/1', follow_redirects=True)
        assert response.status_code == 404
        response = c.get('/01/32/')
        assert response.status_code == 404
        response = c.get('/01/32', follow_redirects=True)<commit_msg>Improve coverage of page load tests<commit_after>import datetime as dt

from flask_application import app

def test_rss():
    with app.test_client() as c:
        response = c.get('/feed.rss')
        assert response.status_code == 200
        assert response.mimetype == 'application/atom+xml'
        assert response.content_length > 100000

def test_daily_westminster_pages_exist():
    start_date = dt.date(2015, 01, 01)

    with app.test_client() as c:
        response = c.get('/')
        assert response.status_code == 200

        for days in range(365):
            date = start_date + dt.timedelta(days=days)
            month, day = date.month, date.day
            response = c.get('/{month:02d}/{day:02d}/'.format(month=month, day=day))
            assert response.status_code == 200

            response = c.get('/{month:02d}/{day:02d}'.format(month=month, day=day),
                             follow_redirects=True)
            assert response.status_code == 200


def test_chief_end_of_man():
    with app.test_client() as c:
        response = c.get('/01/01/')
        assert "chief end of man" in response.data
        response = c.get('/01/02/')
        assert "better preserving and propagating" in response.data


def test_daily_westminster_bad_days():
    with app.test_client() as c:
        response = c.get('/1/1/')
        assert response.status_code == 404
        response = c.get('/1/1', follow_redirects=True)
        assert response.status_code == 404
        response = c.get('/01/32/')
        assert response.status_code == 404
        response = c.get('/01/32', follow_redirects=True)
{'fraction_non_alphanumeric': 0.125128556736373, 'fraction_numerical': 0.0411381556393555, 'mean_word_length': 2.4491725768321513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '340833', 'n_tokens_mistral': 990, 'n_tokens_neox': 873, 'n_words': 208}