<commit_before># coding: utf-8
import unittest

from flask import Flask, Markup, render_template_string
from flask.ext.mistune import Mistune, markdown

app = Flask(__name__)
app.debug = True
Mistune(app)


@app.route('/test')
def mardown_template_filter():
    text = u'~~testing markdown filter~~ *test*'
    return render_template_string('{{ text|markdown }}', text=text)


@app.route('/test2')
def mardown_template_block():
    test = u'*test*'
    text = u'{% filter markdown %}{{ test }}{% endfilter %}'
    return render_template_string(text, test=test)


class MistuneTest(unittest.TestCase):
    def test_render_template_filter(self):
        client = app.test_client()
        resp = client.open('/test')
        self.assertEqual(resp.data, u'<p><del>testing markdown filter</del> '
                         u'<em>test</em></p>\n')

    def test_render_template_block(self):
        client = app.test_client()
        resp = client.open('/test2')
        self.assertEqual(resp.data, u'<p><em>test</em></p>\n')

    def test_markdown_function(self):
        string = u'this is a *markdown* string'
        self.assertEqual(markdown(string), Markup(u'<p>this is a '
                                                  u'<em>markdown</em> '
                                                  u'string</p>\n'))

if __name__ == '__main__':
    unittest.main()<commit_msg>Fix the tests<commit_after># coding: utf-8
import unittest

from flask import Flask, Markup, render_template_string
from flask_mistune import Mistune, markdown

app = Flask(__name__)
app.debug = True
Mistune(app)


@app.route('/test')
def mardown_template_filter():
    text = '~~testing markdown filter~~ *test*'
    return render_template_string('{{ text|markdown }}', text=text)


@app.route('/test2')
def mardown_template_block():
    test = '*test*'
    text = '{% filter markdown %}{{ test }}{% endfilter %}'
    return render_template_string(text, test=test)


class MistuneTest(unittest.TestCase):
    def test_render_template_filter(self):
        client = app.test_client()
        resp = client.open('/test')
        self.assertEqual(resp.data.decode('utf-8'), '<p><del>testing markdown filter</del> '
                         '<em>test</em></p>\n')

    def test_render_template_block(self):
        client = app.test_client()
        resp = client.open('/test2')
        self.assertEqual(resp.data.decode('utf-8'), u'<p><em>test</em></p>\n')

    def test_markdown_function(self):
        string = 'this is a *markdown* string'
        self.assertEqual(markdown(string), Markup('<p>this is a '
                                                  '<em>markdown</em> '
                                                  'string</p>\n'))

if __name__ == '__main__':
    unittest.main()

{'fraction_non_alphanumeric': 0.1467823571945047, 'fraction_numerical': 0.0028922631959508315, 'mean_word_length': 2.7091152815013406, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4162991', 'n_tokens_mistral': 868, 'n_tokens_neox': 839, 'n_words': 172}