<commit_before>from myuw.views.error import not_instructor_error, data_not_found,\
    invalid_session, invalid_input_data, invalid_method, invalid_future_term,\
    data_error
from myuw.test.api import MyuwApiTest


class TestViewsError(MyuwApiTest):

    def test_data_not_found(self):
        response = data_not_found()
        self.assertEquals(response.content, b'Data not found')
        self.assertEquals(response.status_code, 404)

    def test_not_instructor_error(self):
        response = not_instructor_error()
        self.assertEquals(response.content,
                          b'Access Forbidden to Non Instructor')
        self.assertEquals(response.status_code, 403)

    def test_invalid_session(self):
        response = invalid_session()
        self.assertEquals(response.content, b'No valid userid in session')
        self.assertEquals(response.status_code, 400)

    def test_invalid_input_data(self):
        response = invalid_input_data()
        self.assertEquals(response.content, b'Invalid post data content')
        self.assertEquals(response.status_code, 400)

    def test_invalid_method(self):
        response = invalid_method()
        self.assertEquals(response.content, b'Method not allowed')
        self.assertEquals(response.status_code, 405)

    def test_invalid_future_term(self):
        response = invalid_future_term()
        self.assertEquals(response.content, b'Invalid requested future term')
        self.assertEquals(response.status_code, 410)

    def test_data_error(self):
        response = data_error()
        self.assertEquals(response.content,
                          b'Data not available due to an error')
        self.assertEquals(response.status_code, 543)<commit_msg>invalid_future_term log term<commit_after>from myuw.views.error import not_instructor_error, data_not_found,\
    invalid_session, invalid_input_data, invalid_method, invalid_future_term,\
    data_error
from myuw.test.api import MyuwApiTest


class TestViewsError(MyuwApiTest):

    def test_data_not_found(self):
        response = data_not_found()
        self.assertEquals(response.content, b'Data not found')
        self.assertEquals(response.status_code, 404)

    def test_not_instructor_error(self):
        response = not_instructor_error()
        self.assertEquals(response.content,
                          b'Access Forbidden to Non Instructor')
        self.assertEquals(response.status_code, 403)

    def test_invalid_session(self):
        response = invalid_session()
        self.assertEquals(response.content, b'No valid userid in session')
        self.assertEquals(response.status_code, 400)

    def test_invalid_input_data(self):
        response = invalid_input_data()
        self.assertEquals(response.content, b'Invalid post data content')
        self.assertEquals(response.status_code, 400)

    def test_invalid_method(self):
        response = invalid_method()
        self.assertEquals(response.content, b'Method not allowed')
        self.assertEquals(response.status_code, 405)

    def test_invalid_future_term(self):
        response = invalid_future_term("2013,spring")
        self.assertEquals(response.content,
                          b'Invalid requested future term 2013,spring')
        self.assertEquals(response.status_code, 410)

    def test_data_error(self):
        response = data_error()
        self.assertEquals(response.content,
                          b'Data not available due to an error')
        self.assertEquals(response.status_code, 543)
{'fraction_non_alphanumeric': 0.08248587570621468, 'fraction_numerical': 0.014124293785310734, 'mean_word_length': 3.2560096153846154, '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': '5425043', 'n_tokens_mistral': 1004, 'n_tokens_neox': 939, 'n_words': 194}