travis-ci and coverage

This commit is contained in:
BennyThink
2021-01-26 18:12:39 +08:00
parent 32f3219b24
commit d22e7ab391
10 changed files with 19 additions and 17 deletions

13
.gitattributes vendored
View File

@@ -1,14 +1,7 @@
worker/public/css/* linguist-vendored worker/public/css/* linguist-vendored
worker/public/fonts/* linguist-vendored worker/public/fonts/* linguist-vendored
worker/public/img/* linguist-vendored worker/public/img/* linguist-vendored
worker/public/js/* linguist-vendored
worker/public/js/aYin.js linguist-vendored worker/*.html linguist-vendored
worker/public/js/bootstrap.min.js linguist-vendored tests/data/* linguist-vendored
worker/public/js/rrshare.js linguist-vendored
worker/public/js/vue.js linguist-vendored
worker/public/js/jquery* linguist-vendored
worker/public/404.html linguist-vendored
worker/public/index.html linguist-vendored
worker/public/resource.html linguist-vendored
worker/public/search.html linguist-vendored

View File

@@ -1,17 +1,21 @@
language: python language: python
sudo: false
services: services:
- redis - redis
python: python:
- "3.7"
- "3.8" - "3.8"
install: install:
- pip install -r requirements.txt - pip install -r requirements.txt
env: env:
- REDIS=locahost - REDIS=localhost
script: script:
- cd tests && python /build_test.py - cd tests
- python tests/turing_test.py - coverage run test_fansub.py
after_success:
- bash <(curl -s https://codecov.io/bash)

View File

@@ -1,5 +1,9 @@
# YYeTsBot # YYeTsBot
[![Build Status](https://travis-ci.com/tgbot-collection/YYeTsBot.svg?branch=master)](https://travis-ci.com/tgbot-collection/YYeTsBot)
[![codecov](https://codecov.io/gh/tgbot-collection/YYeTsBot/branch/master/graph/badge.svg?token=ZL1GCIF95D)](https://codecov.io/gh/tgbot-collection/YYeTsBot)
人人影视bot[戳我使用](https://t.me/yyets_bot) 人人影视bot[戳我使用](https://t.me/yyets_bot)
此机器人长期维护,如果遇到问题可以发送报告给我。 此机器人长期维护,如果遇到问题可以发送报告给我。

View File

@@ -8,6 +8,7 @@ import requests_mock
from unittest import mock from unittest import mock
sys.path.append("../yyetsbot") sys.path.append("../yyetsbot")
import bot as _
from fansub import BaseFansub, YYeTsOnline from fansub import BaseFansub, YYeTsOnline
@@ -64,7 +65,7 @@ class YYeTsTest(unittest.TestCase):
@requests_mock.mock() @requests_mock.mock()
def test_get_search_html(self, m): def test_get_search_html(self, m):
with open("yyets_search.html") as f: with open("data/yyets_search.html") as f:
html = f.read() html = f.read()
m.get('http://www.rrys2020.com/search?keyword=abc&type=resource', text=html) m.get('http://www.rrys2020.com/search?keyword=abc&type=resource', text=html)
response = self.ins.__get_search_html__("abc") response = self.ins.__get_search_html__("abc")

View File

@@ -53,5 +53,5 @@
src="img/200-wrangler-ferris.gif"> src="img/200-wrangler-ferris.gif">
</div> </div>
</body> </body>
<script src="js/search.js"></script> <script src="custom/search.js"></script>
</html> </html>

View File

@@ -54,7 +54,7 @@
<h2>有问题请联系 <a style="text-decoration: none;color: green" href="https://t.me/BennyThink">Benny小可爱</a></h2> <h2>有问题请联系 <a style="text-decoration: none;color: green" href="https://t.me/BennyThink">Benny小可爱</a></h2>
</div> </div>
</body> </body>
<script src="js/search.js"></script> <script src="custom/search.js"></script>
<script> <script>
let kwe = document.URL.split("kw=")[1]; let kwe = document.URL.split("kw=")[1];
let kw = decodeURI(kwe).toLowerCase().replace(" ", ""); let kw = decodeURI(kwe).toLowerCase().replace(" ", "");