diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 623c947..0febb08 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -8,7 +8,7 @@ on: [push, pull_request] jobs: build: - runs-on: ubuntu-latest + runs-on: windows-2019 steps: - uses: actions/checkout@v2 @@ -20,7 +20,7 @@ jobs: run: | python -m pip install --upgrade pip pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + pip install -r requirements.txt; - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names @@ -29,5 +29,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - export PYTHONPATH=source pytest \ No newline at end of file diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index 7be1a6d..3ba0e50 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -1,8 +1,10 @@ import sys # insert at 1, 0 is the script path (or '' in REPL) -sys.path.append('main') +sys.path.append('source') -from main import helper +from source.main import helper +from source.main import transcribe_yt +from source.main import summarize # from main import helper @@ -26,6 +28,20 @@ def test_analyzeText(): assert helper.analyze("sad")[0] in sentiments assert helper.analyze("very happy")[0] in sentiments assert helper.analyze("decent")[0] in sentiments + + +def test_Summary(): + temp = summarize.Summary("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old").summarize_text() + assert type(temp) == list and len(temp) > 0 +# def test_transcribeVideo(): +# assert type(TranscribeYtVideo('https://www.youtube.com/watch?v=yaG9mFlrB8k&ab_channel=9to5Mac').transcribe_yt_video()) == str + # def test_always_fails(): # assert False + + +def test_transcribeVideo(): + temp = transcribe_yt.TranscribeYtVideo('https://www.youtube.com/watch?v=yaG9mFlrB8k&ab_channel=9to5Mac%27') + assert type(temp.transcribe_yt_video()) == str +