def test1(self): event = Event.from_payload(self.payload) bot = SearchBot() self.assertTrue(bot.match(event, event.message)) result = call_async_func(bot.reply(event)) print(result) self.assertTrue(len(result) > 20)
def get_seclist_fulldisclose() -> str: def filter_malvuln(text: str) -> bool: return 'malvuln' not in text lst = [filter_malvuln] return call_async_func( get_rss_push("https://seclists.org/rss/fulldisclosure.rss", lst, desc_len=0))
def test1(self): result = call_async_func(search_anquanke_vuln('CVE-2020-0022')) print(result) self.assertTrue(len(result) != 0)
def test2(self): result = call_async_func(rsshub_weibo_article(5582522936, '每日安全动态推送', False)) print(result) self.assertTrue(len(result) != 0)
def test1(self): result = call_async_func( get_rss_push('https://seclists.org/rss/fulldisclosure.rss', None, False)) print(result[:20]) self.assertTrue(len(result) != 0)
def test3(self): result = call_async_func( get_rss_push('https://rsshub.ioiox.com/weibo/user/2803301701')) print(result) self.assertTrue(isinstance(result, str))
def test2(self): result = call_async_func(get_360_boardcast(False)) print(result[:20]) self.assertTrue(len(result) != 0)
def get_ctf_event() -> str: return call_async_func(ctfhub_get_upcoming_event())
def get_phoronix() -> str: return call_async_func( get_rss_push("https://www.phoronix.com/rss.php", item_limit=5, desc_len=0))
def get_360_boardcast_sync() -> str: return call_async_func(get_360_boardcast())
def get_xuanwu_push_sync() -> str: """ 获取待推送内容 """ return call_async_func(get_xuanwu_push())
def test1(self): result = call_async_func(bing("单元测试")) print(result) self.assertTrue(len(result) != 0)