<commit_before>import unittest

from robot.reporting.webcontentfile import WebContentFile
from robot.utils.asserts import assert_true, assert_raises, assert_equals


class TestRobotFileReading(unittest.TestCase):

    def test_get_webcontent_file(self):
        log = WebContentFile('log.html')
        assert_true(list(log))

    def test_lines_have_line_breaks(self):
        for line in WebContentFile('report.html'):
            assert_equals(line[-1], '\n')<commit_msg>Fixed WebContentFile tests after exluding line breaks and also enhanced tests a little.<commit_after>import unittest

from robot.reporting.webcontentfile import WebContentFile
from robot.utils.asserts import assert_true, assert_raises, assert_equals


class TestWebContentFile(unittest.TestCase):

    def test_get_webcontent_file(self):
        log = list(WebContentFile('log.html'))
        assert_true(log[0].startswith('<!DOCTYPE'))
        assert_equals(log[-1], '</html>')

    def test_lines_do_not_have_line_breaks(self):
        for line in WebContentFile('report.html'):
            assert_true(not line.endswith('\n'))
{'fraction_non_alphanumeric': 0.09791477787851315, 'fraction_numerical': 0.0027198549410698096, 'mean_word_length': 4.604060913705584, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '917078', 'n_tokens_mistral': 332, 'n_tokens_neox': 320, 'n_words': 67}