<commit_before>import unittest
from request_handler import Forms, create_msg
from werkzeug.test import Client
from werkzeug.testapp import test_app
from werkzeug.wrappers import BaseResponse, Request
from werkzeug.test import EnvironBuilder
from StringIO import StringIO


class Test_formsender(unittest.TestCase):

    def test_create_msg_with_content(self):
        builder = EnvironBuilder(method='POST',
                                 data={'foo' : 'this is some text',
                                      'file': 'my file contents',
                                      'test': 'test.txt'})
        env = builder.get_environ()
        request = Request(env)
        assert (create_msg(request)['foo'] == builder.form['foo'] and
               create_msg(request)['file'] == builder.form['file'] and
               create_msg(request)['test'] == builder.form['test'])

    def test_create_msg_no_content(self):
        builder = EnvironBuilder(method='POST', data={})
        env = builder.get_environ()
        request = Request(env)
        assert create_msg(request) is None

    def test_create_msg_no_content_get_method(self):
        builder = EnvironBuilder(method='GET', data={})
        env = builder.get_environ()
        request = Request(env)
        assert create_msg(request) is None

    def test_send_email(self):
        form = Forms()
        assert form.send_email({'age': u'test', 'name': u'dict'})


if __name__ == '__main__':
    unittest.main()<commit_msg>Cleaned up variable names<commit_after>import unittest
from request_handler import Forms, create_msg
from werkzeug.test import Client
from werkzeug.testapp import test_app
from werkzeug.wrappers import BaseResponse, Request
from werkzeug.test import EnvironBuilder
from StringIO import StringIO


class Test_formsender(unittest.TestCase):

    def test_create_msg_with_content(self):
        builder = EnvironBuilder(method='POST',
                                 data={'foo' : 'this is some text',
                                      'file': 'my file contents',
                                      'test': 'test.txt'})
        env = builder.get_environ()
        req = Request(env)
        assert (create_msg(req)['foo'] == builder.form['foo'] and
               create_msg(req)['file'] == builder.form['file'] and
               create_msg(req)['test'] == builder.form['test'])

    def test_create_msg_no_content(self):
        builder = EnvironBuilder(method='POST', data={})
        env = builder.get_environ()
        req = Request(env)
        assert create_msg(req) is None

    def test_create_msg_no_content_get_method(self):
        builder = EnvironBuilder(method='GET', data={})
        env = builder.get_environ()
        req = Request(env)
        assert create_msg(req) is None

    def test_send_email(self):
        app = Forms()
        assert app.send_email({'age': u'test', 'name': u'dict'})


if __name__ == '__main__':
    unittest.main()
{'fraction_non_alphanumeric': 0.11238997968855789, 'fraction_numerical': 0.0, 'mean_word_length': 2.6391625615763545, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '717861', 'n_tokens_mistral': 843, 'n_tokens_neox': 840, 'n_words': 196}