コード例 #1
0
ファイル: test_main.py プロジェクト: thy97/pakku.js
#coding=utf-8
import testrunner as runner
from xml.dom.minidom import *
import json
import time

EXAMPLE_DANMAKU = 'https://api.bilibili.com/x/v1/dm/list.so?oid=3262388'


def demo(fn):
    with open('demo/%s.xml' % fn, 'r', encoding='utf-8') as f:
        return f.read()


print('== reset settings')
runner.update_settings('MAX_DIST', '0')
runner.update_settings('MAX_COSINE', '1000')
runner.update_settings('PROC_TYPE7', 'on')
runner.update_settings('PROC_TYPE4', 'on')
runner.update_settings('PROC_POOL1', 'on')
runner.update_settings('TRIM_ENDING', 'off')
runner.update_settings('TRIM_SPACE', 'off')
runner.update_settings('TRIM_WIDTH', 'off')
runner.update_settings('DANMU_SUBSCRIPT', 'off')
runner.update_settings('FORCELIST', '[]')
runner.update_settings('WHITELIST', '[]')
runner.update_settings('THRESHOLD', '20')
runner.update_settings('MARK_THRESHOLD', '1')
runner.update_settings('HIDE_THRESHOLD', '0')
runner.update_settings('SCROLL_THRESHOLD', '0')
runner.update_settings('AUTO_DANMU_LIST', 'on')
コード例 #2
0
#coding=utf-8
import testrunner as runner
from xml.dom.minidom import *
import json
import time


def demo(fn):
    with open('demo/%s.xml' % fn, 'r', encoding='utf-8') as f:
        return f.read()


print('== reset settings')
runner.update_settings('MAX_DIST', '0')
runner.update_settings('MAX_COSINE', '1000')
runner.update_settings('PROC_TYPE7', 'off')
runner.update_settings('TRIM_ENDING', 'off')
runner.update_settings('TRIM_SPACE', 'off')
runner.update_settings('TRIM_WIDTH', 'off')
runner.update_settings('TAOLUS', '[]')
runner.update_settings('WHITELIST', '[]')
runner.update_settings('THRESHOLD', '20')
runner.update_settings('MARK_THRESHOLD', '1')

# not tested: FLASH_NOTIF POPUP_BADGE

print('!= test webrequest hook')

runner.set_global_switch(False)
runner.b.get('http://comment.bilibili.com/1.xml?debug')
assert not runner.b.current_url.startswith('data:')