<commit_before># coding:utf-8
import unittest


class TestWeiboSpider(unittest.TestCase):
    # 这单元测试写得我很尴尬...
    def test_get_login_info(self):
        from db import login_info
        infos = login_info.get_login_info()
        self.assertEquals(len(infos), 5)

    def test_login(self):
        """
        是测试是否能成功登录的，然后登录后会把cookie保存到redis中
        """
        import random
        from wblogin.login import get_session
        from db.login_info import get_login_info
        infos = get_login_info()
        if not infos:
            raise Exception('未获取到登陆信息')

        info = random.choice(infos)
        sc = get_session(info.name, info.password)

        if sc:
            print('登陆成功')
        else:
            raise Exception('登录失败')

    def test_freeze_account(self):
        """<commit_msg>修改登录测试<commit_after># coding:utf-8
import unittest


class TestWeiboSpider(unittest.TestCase):
    # 这单元测试写得我很尴尬...
    def test_get_login_info(self):
        from db import login_info
        infos = login_info.get_login_info()
        self.assertEquals(len(infos), 5)

    def test_login(self):
        """
        是测试是否能成功登录的，然后登录后会把cookie保存到redis中
        """
        import random
        from wblogin.login import get_session
        from db.login_info import get_login_info
        infos = get_login_info()
        if not infos:
            raise Exception('未获取到登陆信息')

        info = random.choice(infos)
        sc = get_session(info.name, info.password, info.need_verify)

        if sc:
            print('登陆成功')
        else:
            raise Exception('登录失败')

    def test_freeze_account(self):
        """
{'fraction_non_alphanumeric': 0.09074187614960147, 'fraction_numerical': 0.002452483139178418, 'mean_word_length': 2.181286549707602, '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': '2436276', 'n_tokens_mistral': 576, 'n_tokens_neox': 610, 'n_words': 101}