From 9326a9a2d79bf5964dde8d094437143e45929ea1 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 15:00:47 -0400 Subject: [PATCH 01/11] added tests for TranscribeYT and Summary --- test/test_with_pytest.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index 34686b7..37a8d83 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -2,7 +2,9 @@ # insert at 1, 0 is the script path (or '' in REPL) sys.path.append('source/main') -import helper +from main import helper +from main import summarize +from main.transcribe_yt import TranscribeYtVideo def test_always_passes(): assert True @@ -25,5 +27,13 @@ def test_analyzeText(): assert helper.analyze("very happy")[0] in sentiments assert helper.analyze("decent")[0] in sentiments +# from main.summarize import Summary + +def test_Summary(): + assert type(summary.Summarize("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old")) == str + +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 From 7304d5879548329b56d041791d055a9fb2eb7cba Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 15:39:43 -0400 Subject: [PATCH 02/11] summarize test --- test/test_with_pytest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index 37a8d83..6627a6e 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -30,7 +30,7 @@ def test_analyzeText(): # from main.summarize import Summary def test_Summary(): - assert type(summary.Summarize("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old")) == str + assert type(summarize.Summarize("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old")) == str def test_transcribeVideo(): assert type(TranscribeYtVideo('https://www.youtube.com/watch?v=yaG9mFlrB8k&ab_channel=9to5Mac').transcribe_yt_video()) == str From 1f95e3c72fab50426a5b3396f526c47337af59df Mon Sep 17 00:00:00 2001 From: Pratik Devnani <43350493+pratikdevnani@users.noreply.github.com> Date: Wed, 3 Nov 2021 15:47:50 -0400 Subject: [PATCH 03/11] fixed cinflicts --- conftest.py | 0 test/test_with_pytest.py | 20 ++++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 conftest.py 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 6627a6e..dc47b69 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -1,10 +1,12 @@ import sys # insert at 1, 0 is the script path (or '' in REPL) -sys.path.append('source/main') +sys.path.append('source') +# sys.path.append('main') -from main import helper -from main import summarize -from main.transcribe_yt import TranscribeYtVideo +from source.main import helper +from source.main import transcribe_yt + +# from main import helper def test_always_passes(): assert True @@ -32,8 +34,14 @@ def test_analyzeText(): def test_Summary(): assert type(summarize.Summarize("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old")) == str -def test_transcribeVideo(): - assert type(TranscribeYtVideo('https://www.youtube.com/watch?v=yaG9mFlrB8k&ab_channel=9to5Mac').transcribe_yt_video()) == str +# 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 + From 802bae4a614e21c515911c28c1d70031ff2818a5 Mon Sep 17 00:00:00 2001 From: Pratik Devnani <43350493+pratikdevnani@users.noreply.github.com> Date: Wed, 3 Nov 2021 17:01:04 -0400 Subject: [PATCH 04/11] working test file --- test/test_with_pytest.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index dc47b69..6c31ed3 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -5,6 +5,7 @@ from source.main import helper from source.main import transcribe_yt +from source.main import summarize # from main import helper @@ -29,10 +30,10 @@ def test_analyzeText(): assert helper.analyze("very happy")[0] in sentiments assert helper.analyze("decent")[0] in sentiments -# from main.summarize import Summary def test_Summary(): - assert type(summarize.Summarize("the snail smelly old beermongers . the snail stinky old beersmonger's squirmy old")) == str + 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 From 9655acdea4e39f05f871e584b886b6c973de7c68 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 19:20:33 -0400 Subject: [PATCH 05/11] removed source and kept only main in imports --- test/test_with_pytest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index 3caaecb..45e5f75 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -2,9 +2,9 @@ # insert at 1, 0 is the script path (or '' in REPL) sys.path.append('main') -from source.main import helper -from source.main import transcribe_yt -from source.main import summarize +from main import helper +from main import transcribe_yt +from main import summarize # from main import helper @@ -28,12 +28,12 @@ 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 From 500eb4460eb93bcb366ca3972f1fdb9e79098ff2 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 19:29:48 -0400 Subject: [PATCH 06/11] changed linux to windows latest workflow --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 623c947..15f2f85 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-latest steps: - uses: actions/checkout@v2 From 0f3f1c4e983cd1cd3fd47a5fa6d29c59e004bd17 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 19:32:41 -0400 Subject: [PATCH 07/11] fixed python requirements error --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 15f2f85..06de3e2 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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 From 78d1ffae4f1a52e60c3edf92eed27cefbc3bff09 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 19:40:25 -0400 Subject: [PATCH 08/11] removed setting python path to source --- .github/workflows/python-app.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 06de3e2..22dcc1a 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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 From e276c8a9d036154272d70002d04d432e60f3f149 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 19:49:53 -0400 Subject: [PATCH 09/11] changed to source.main --- test/test_with_pytest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index 45e5f75..d8828c3 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -2,9 +2,9 @@ # insert at 1, 0 is the script path (or '' in REPL) sys.path.append('main') -from main import helper -from main import transcribe_yt -from main import summarize +from source.main import helper +from source.main import transcribe_yt +from source.main import summarize # from main import helper From 9d308d8771910a3792960e3a743bfe6e48f401b8 Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 20:18:13 -0400 Subject: [PATCH 10/11] appending source --- test/test_with_pytest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_with_pytest.py b/test/test_with_pytest.py index d8828c3..3ba0e50 100644 --- a/test/test_with_pytest.py +++ b/test/test_with_pytest.py @@ -1,6 +1,6 @@ import sys # insert at 1, 0 is the script path (or '' in REPL) -sys.path.append('main') +sys.path.append('source') from source.main import helper from source.main import transcribe_yt From 20c355eb01854bb2e2ceb9d1dbc544eafda8278f Mon Sep 17 00:00:00 2001 From: Rahil Sarvaiya Date: Wed, 3 Nov 2021 20:26:52 -0400 Subject: [PATCH 11/11] appending source --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 22dcc1a..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: windows-latest + runs-on: windows-2019 steps: - uses: actions/checkout@v2