<commit_before>from tests.bases import BaseApplicationTest


class TestStatus(BaseApplicationTest):

    def test_should_return_200_from_elb_status_check(self):
        status_response = self.client.get('/_status?ignore-dependencies')
        assert status_response.status_code == 200
<commit_msg>Test coverage for SQLAlchemyError handling in status view<commit_after>from tests.bases import BaseApplicationTest
from sqlalchemy.exc import SQLAlchemyError
import mock


class TestStatus(BaseApplicationTest):

    def test_should_return_200_from_elb_status_check(self):
        status_response = self.client.get('/_status?ignore-dependencies')
        assert status_response.status_code == 200

    @mock.patch('app.status.utils.get_db_version')
    def test_catches_db_error_and_return_500(self, get_db_version):
        get_db_version.side_effect = SQLAlchemyError()
        status_response = self.client.get('/_status')
        assert status_response.status_code == 500

{'fraction_non_alphanumeric': 0.07716049382716049, 'fraction_numerical': 0.018518518518518517, 'mean_word_length': 5.119496855345912, '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': '7636737', 'n_tokens_mistral': 303, 'n_tokens_neox': 276, 'n_words': 50}