<commit_before># from django.test import TestCase

# Create your tests here.<commit_msg>133 Test that the api endpoint is live<commit_after>from django.test import Client, TestCase


class ApiTest(TestCase):
    """Test for API"""

    def setUp(self):
        self.client = Client()
        self.endpoint = '/api'

    def test_api_endpoint_is_live(self):
        r = self.client.get(self.endpoint, {'query': ''})

        self.assertEqual(400, r.status_code)
        self.assertEqual('Must provide query string.', r.json()['errors'][0]['message'])
{'fraction_non_alphanumeric': 0.1366120218579235, 'fraction_numerical': 0.012750455373406194, 'mean_word_length': 3.5833333333333335, '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': '3659876', 'n_tokens_mistral': 166, 'n_tokens_neox': 159, 'n_words': 43}