From d84af2de34d45774d1f8f02399c54067ce20e548 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Tue, 9 Oct 2018 15:36:48 -0700 Subject: [PATCH 1/3] point to specific URIs for video analyze snippets --- video/cloud-client/analyze/analyze_test.py | 17 +++-------------- .../cloud-client/analyze/beta_snippets_test.py | 7 +------ 2 files changed, 4 insertions(+), 20 deletions(-) diff --git a/video/cloud-client/analyze/analyze_test.py b/video/cloud-client/analyze/analyze_test.py index 60a01789a1d..13126c523fd 100644 --- a/video/cloud-client/analyze/analyze_test.py +++ b/video/cloud-client/analyze/analyze_test.py @@ -14,38 +14,27 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - import pytest import analyze -BUCKET = os.environ['CLOUD_STORAGE_BUCKET'] -LABELS_FILE_PATH = '/video/cat.mp4' -EXPLICIT_CONTENT_FILE_PATH = '/video/cat.mp4' -SHOTS_FILE_PATH = '/video/gbikes_dinosaur.mp4' - - @pytest.mark.slow def test_analyze_shots(capsys): - analyze.analyze_shots( - 'gs://{}{}'.format(BUCKET, SHOTS_FILE_PATH)) + analyze.analyze_shots('gs://demomaker/gbikes_dinosaur.mp4') out, _ = capsys.readouterr() assert 'Shot 1:' in out @pytest.mark.slow def test_analyze_labels(capsys): - analyze.analyze_labels( - 'gs://{}{}'.format(BUCKET, LABELS_FILE_PATH)) + analyze.analyze_labels('gs://demomaker/cat.mp4') out, _ = capsys.readouterr() assert 'label description: cat' in out @pytest.mark.slow def test_analyze_explicit_content(capsys): - analyze.analyze_explicit_content( - 'gs://{}{}'.format(BUCKET, EXPLICIT_CONTENT_FILE_PATH)) + analyze.analyze_explicit_content('gs://demomaker/cat.mp4') out, _ = capsys.readouterr() assert 'pornography' in out diff --git a/video/cloud-client/analyze/beta_snippets_test.py b/video/cloud-client/analyze/beta_snippets_test.py index e86f4f8c0f5..3583edcd6fd 100644 --- a/video/cloud-client/analyze/beta_snippets_test.py +++ b/video/cloud-client/analyze/beta_snippets_test.py @@ -14,19 +14,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - import pytest import beta_snippets -BUCKET = os.environ['CLOUD_STORAGE_BUCKET'] -FILE_PATH = 'video/googlework_short.mp4' - @pytest.mark.slow def test_speech_transcription(capsys): beta_snippets.speech_transcription( - 'gs://{}/{}'.format(BUCKET, FILE_PATH)) + 'gs://python-docs-samples-tests/video/googlework_short.mp4') out, _ = capsys.readouterr() assert 'cultural' in out From f3452071f2beec352cb0e8083ce776fff62c9491 Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Tue, 9 Oct 2018 15:55:17 -0700 Subject: [PATCH 2/3] point to specific URIs for video labels snippets --- video/cloud-client/labels/labels_test.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/video/cloud-client/labels/labels_test.py b/video/cloud-client/labels/labels_test.py index 0472e2194e1..ae455b90c64 100644 --- a/video/cloud-client/labels/labels_test.py +++ b/video/cloud-client/labels/labels_test.py @@ -14,20 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - import pytest import labels -BUCKET = os.environ['CLOUD_STORAGE_BUCKET'] -LABELS_FILE_PATH = '/video/cat.mp4' - - @pytest.mark.slow def test_feline_video_labels(capsys): - labels.analyze_labels( - 'gs://{}{}'.format(BUCKET, LABELS_FILE_PATH)) + labels.analyze_labels('gs://demomaker/cat.mp4') out, _ = capsys.readouterr() assert 'Video label description: cat' in out From f0ce869ec6fc9a885c6e4e92684f42b4dcf7202c Mon Sep 17 00:00:00 2001 From: Alix Hamilton Date: Tue, 9 Oct 2018 16:08:11 -0700 Subject: [PATCH 3/3] point to specific URIs for shot change snippets --- video/cloud-client/shotchange/shotchange_test.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/video/cloud-client/shotchange/shotchange_test.py b/video/cloud-client/shotchange/shotchange_test.py index a004f56d5cd..752e595cd7d 100644 --- a/video/cloud-client/shotchange/shotchange_test.py +++ b/video/cloud-client/shotchange/shotchange_test.py @@ -14,19 +14,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os - import pytest import shotchange -BUCKET = os.environ['CLOUD_STORAGE_BUCKET'] -SHOTS_FILE_PATH = '/video/gbikes_dinosaur.mp4' - @pytest.mark.slow def test_shots_dino(capsys): - shotchange.analyze_shots( - 'gs://{}{}'.format(BUCKET, SHOTS_FILE_PATH)) + shotchange.analyze_shots('gs://demomaker/gbikes_dinosaur.mp4') out, _ = capsys.readouterr() assert 'Shot 1:' in out