<commit_before>import unittest
from test.testmodeltestcase import TestModelTestCase as Super

class TemplateTestCase(Super):

    def setUp(self):
        Super.setUp(self)
        self.browser.get(self.base_url + '/templates.do')
        self.template_name = "Search for Managers"

    def elem(self, selector):
        return self.browser.find_element_by_css_selector(selector)

    def testTemplatesPageTitle(self):
        self.assertIn('Template queries', self.browser.title)

    def findLink(self):
        return self.browser.find_element_by_link_text(self.template_name)

    def testFindTemplate(self):
        template_link = self.findLink()
        self.assertIsNotNone(template_link, "Expected to find link")
        self.assertTrue(
            template_link.is_displayed(),
            "Expected link to be visible to user"
        )

    def testRunTemplate(self):
        template_link = self.findLink()
        template_link.click()
        self.assertIn('Search for Managers', self.browser.title)
        button = self.elem("#smallGreen.button input")
        self.assertIsNotNone(button, "Expected to find button to run template")
        button.click()
        summary = self.elem(".im-table-summary")
        self.assertIsNotNone(button, "Expected to find a summary of the template results")
        self.assertEqual("Showing 1 to 2 of 2 rows", summary.text)
<commit_msg>dried up the test a bit<commit_after>import unittest
from test.testmodeltestcase import TestModelTestCase as Super

class TemplateTestCase(Super):

    def setUp(self):
        Super.setUp(self)
        self.browser.get(self.base_url + '/templates.do')
        self.template_name = "Search for Managers"

    def elem(self, selector):
        return self.browser.find_element_by_css_selector(selector)

    def testTemplatesPageTitle(self):
        self.assertIn('Template queries', self.browser.title)

    def findLink(self):
        return self.browser.find_element_by_link_text(self.template_name)

    def testFindTemplate(self):
        template_link = self.findLink()
        self.assertIsNotNone(template_link, "Expected to find link")
        self.assertTrue(
            template_link.is_displayed(),
            "Expected link to be visible to user"
        )

    def testRunTemplate(self):
        template_link = self.findLink()
        template_link.click()
        self.assertIn(self.template_name, self.browser.title)
        button = self.elem("#smallGreen.button input")
        self.assertIsNotNone(button, "Expected to find button to run template")
        button.click()
        summary = self.elem(".im-table-summary")
        self.assertIsNotNone(button, "Expected to find a summary of the template results")
        self.assertEqual("Showing 1 to 2 of 2 rows", summary.text)

{'fraction_non_alphanumeric': 0.09488005728607232, 'fraction_numerical': 0.0021482277121374865, 'mean_word_length': 3.0551523947750363, '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': '5621834', 'n_tokens_mistral': 788, 'n_tokens_neox': 770, 'n_words': 187}