Merge pull request #22 from wakamezake/github_actions

Add GitHub actions
This commit is contained in:
taizan-hokuto
2020-11-15 16:05:13 +09:00
committed by GitHub
2 changed files with 30 additions and 2 deletions

27
.github/workflows/run_test.yml vendored Normal file
View File

@@ -0,0 +1,27 @@
name: Run All UnitTest
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.7, 3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements_test.txt
- name: Test with pytest
run: |
export PYTHONPATH=./
pytest --verbose --color=yes

View File

@@ -1,4 +1,4 @@
from datetime import datetime
from datetime import datetime, timedelta, timezone
class Author:
@@ -90,7 +90,8 @@ class BaseRenderer:
self.chat.author.badgeUrl = badge["liveChatAuthorBadgeRenderer"]["customThumbnail"]["thumbnails"][0]["url"]
def get_datetime(self, timestamp):
dt = datetime.fromtimestamp(timestamp / 1000000)
jst = timezone(timedelta(hours=9))
dt = datetime.fromtimestamp(timestamp / 1000000, jst)
return dt.strftime('%Y-%m-%d %H:%M:%S')
def get_chatobj(self):