<commit_before>from django.test import TestCase
from django.test import Client
from ..models import Busline
from ..models import Terminal

STATUS_OK = 200
STATUS_NOT_FOUND = 404
BUSLINE_NOT_FOUND_ID = 99999999


class TestSearchResultView(TestCase):

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

        self.busline = Busline()

        self.busline.line_number = '001'
        self.busline.description = 'route'
        self.busline.route_size = 0.1
        self.busline.fee = 3.50
        self.terminal = Terminal(description="terminal")
        self.terminal.save()
        self.busline.save()
        self.busline.terminals.add(self.terminal)

    def test_get(self):
        response = self.client.get("/buslines/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)

    def test_get_busline(self):
        bus = Busline.objects.get(description="route")
        response = self.client.get(
            "/buslines/" + str(bus.id) + "/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)

    def test_get_busline_not_found(self):
        response = self.client.get(
            '/buslines/' + str(BUSLINE_NOT_FOUND_ID) + "/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)<commit_msg>Terminal test view<commit_after>from django.test import TestCase
from django.test import Client
from ..models import Busline
from ..models import Terminal

STATUS_OK = 200
STATUS_NOT_FOUND = 404
BUSLINE_NOT_FOUND_ID = 99999999


class TestSearchResultView(TestCase):

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

        self.busline = Busline()

        self.busline.line_number = '001'
        self.busline.description = 'route'
        self.busline.route_size = 0.1
        self.busline.fee = 3.50
        self.terminal = Terminal(description="terminal")
        self.terminal.save()
        self.busline.save()
        self.busline.terminals.add(self.terminal)

    def test_get(self):
        response = self.client.get("/buslines/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)

    def test_get_busline(self):
        bus = Busline.objects.get(description="route")
        response = self.client.get(
            "/buslines/" + str(bus.id) + "/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)

    def test_get_busline_not_found(self):
        response = self.client.get(
            '/buslines/' + str(BUSLINE_NOT_FOUND_ID) + "/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)


class TestTerminalSearchResultView(TestCase):

    def setUp(self):
        self.terminal = Terminal()

        self.terminal.description = "Terminal Description Test String"
        self.terminal.addres = "Terminal Adress Test String "
        self.terminal.save()

    def test_get(self):
        response = self.client.get("/terminals/")
        code = response.status_code
        self.assertEquals(code, STATUS_OK)

    def test_get_terminal(self):
        terminal = self.terminal.id
        response = self.client.get("/terminals/%s/" % str(terminal))
        code = response.status_code
        self.assertEquals(code, STATUS_OK)
{'fraction_non_alphanumeric': 0.10935073004038522, 'fraction_numerical': 0.013668841255048152, 'mean_word_length': 2.638418079096045, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3846976', 'n_tokens_mistral': 1028, 'n_tokens_neox': 953, 'n_words': 183}