Merge pull request #22 from wakamezake/github_actions
Add GitHub actions
This commit is contained in:
27
.github/workflows/run_test.yml
vendored
Normal file
27
.github/workflows/run_test.yml
vendored
Normal 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
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
from datetime import datetime
|
from datetime import datetime, timedelta, timezone
|
||||||
|
|
||||||
|
|
||||||
class Author:
|
class Author:
|
||||||
@@ -90,7 +90,8 @@ class BaseRenderer:
|
|||||||
self.chat.author.badgeUrl = badge["liveChatAuthorBadgeRenderer"]["customThumbnail"]["thumbnails"][0]["url"]
|
self.chat.author.badgeUrl = badge["liveChatAuthorBadgeRenderer"]["customThumbnail"]["thumbnails"][0]["url"]
|
||||||
|
|
||||||
def get_datetime(self, timestamp):
|
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')
|
return dt.strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
def get_chatobj(self):
|
def get_chatobj(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user