<commit_before>from django.test import Client, TestCase
from django.core.urlresolvers import reverse

import views


class DocsTestCase(TestCase):

    def setUp(self):
        self.client = Client()

    def test_index(self):
        response = self.client.get(reverse(views.index))
        self.assertEqual(response.status_code, 200)

    def test_common_errors(self):
        response = self.client.get(reverse(views.docs_pages, args=("common_errors", )))
        self.assertEqual(response.status_code, 200)

    def test_one_liners(self):
        response = self.client.get(reverse(views.docs_pages, args=("one_liners", )))
        self.assertEqual(response.status_code, 200)

    def test_technical(self):
        response = self.client.get(reverse(views.docs_pages, args=("technical", )))
        self.assertEqual(response.status_code, 200)

    def test_resources(self):
        response = self.client.get(reverse(views.docs_pages, args=("resources", )))
        self.assertEqual(response.status_code, 200)

    def test_api(self):
        response = self.client.get(reverse(views.docs_pages, args=("api", )))
        self.assertEqual(response.status_code, 200)

    def test_naming_scheme(self):
        response = self.client.get(reverse(views.docs_pages, args=("naming_scheme", )))
        self.assertEqual(response.status_code, 200)<commit_msg>Generalize the docs tests<commit_after>import os

from django.test import Client, TestCase
from django.core.urlresolvers import reverse

import views


class DocsTestCase(TestCase):

    def setUp(self):
        self.client = Client()

    def test_index(self):
        response = self.client.get(reverse(views.index))
        self.assertEqual(response.status_code, 200)

    def test_doc_pages(self):
        names = os.listdir("docs/other")
        pages = [x.replace("_plain", "").replace(".md", "") for x in names]
        pages += ["technical"]

        for page in pages:
            response = self.client.get(reverse(views.docs_pages, args=(page, )))
            self.assertEqual(response.status_code, 200)
{'fraction_non_alphanumeric': 0.125181246979217, 'fraction_numerical': 0.01304978250362494, 'mean_word_length': 3.5295404814004376, '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': '6384610', 'n_tokens_mistral': 652, 'n_tokens_neox': 605, 'n_words': 114}