<commit_before>"""
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".

Replace this with more appropriate tests for your application.
"""

from django.test import TestCase


class SimpleTest(TestCase):
    def test_basic_addition(self):
        """
        Tests that 1 + 1 always equals 2.
        """
        self.assertEqual(1 + 1, 2)<commit_msg>add tests.py<commit_after># -*- coding:utf-8 -*-
"""
# Author: <NAME> (<EMAIL>, http://ningning.today)
# Created Time : Tue Mar  3 19:44:02 2015

# File Name: tests.py
# Description:

"""
import requests
import codecs

f = codecs.open(u'post.xml', u'r', u'utf-8')
content = u''.join(f.readlines())
f.close()

res = requests.post(u'http://2.pegasuswang.sinaapp.com/wechat/', data=content.encode(u'utf-8'))
print res.text
{'fraction_non_alphanumeric': 0.15096618357487923, 'fraction_numerical': 0.025362318840579712, 'mean_word_length': 3.764367816091954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, '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': '2526488', 'n_tokens_mistral': 293, 'n_tokens_neox': 269, 'n_words': 78}