Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
truethari committed Apr 19, 2021
1 parent 3d66b23 commit 242d2af
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/thumb-gen.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: thumb-gen

on:
push:
branches: [ master ]
paths-ignore:
- '**/README.md'
- '**/README.rst'
- 'thumb_gen/version.py'
pull_request:
branches: [ master ]
Expand All @@ -31,8 +27,9 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install pytest Pillow infomedia opencv-python
pip install -r requirements.txt
python setup.py install
sudo wget -P /home/ "https://www.learningcontainer.com/wp-content/uploads/2020/05/sample-mp4-file.mp4"
sudo apt-get install ffmpeg
- name: Test with pytest
run: |
pytest tests
Expand Down
17 changes: 12 additions & 5 deletions tests/test_worker.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import pytest

from thumb_gen.worker import Generator
from thumb_gen import Generator

def test_worker():
#video_path, output_path='', custom_text='True', font_dir='', font_size=0
#video_path, output_path='', custom_text=True, font_dir='', font_size=0, bg_colour='', font_colour=''

def test_worker_1():
video_path = "/home/sample-mp4-file.mp4"
output_path = "/home/runner/work/thumb-gen/thumb-gen/"
app = Generator(video_path, output_path, "thumb gen")
test_worker_value = app.run()
assert test_worker_value == True

def test_worker_2():
video_path = "/home/sample-mp4-file.mp4"
output_path = "/home/runner/work/thumb-gen/thumb-gen/"
custom_text = "thumb gen"
app = Generator(video_path, output_path, custom_text)
app = Generator(video_path, output_path, font_size=10, bg_colour="yellow", font_colour="black")
test_worker_value = app.run()
assert test_worker_value == True

0 comments on commit 242d2af

Please sign in to comment.