Skip to content

Commit ca1051a

Browse files
authored
Use explicit URIs for Video Intelligence sample tests (GoogleCloudPlatform#1743)
1 parent 07408b1 commit ca1051a

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

video/cloud-client/analyze/analyze_test.py

+3-14
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,27 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
18-
1917
import pytest
2018

2119
import analyze
2220

2321

24-
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
25-
LABELS_FILE_PATH = '/video/cat.mp4'
26-
EXPLICIT_CONTENT_FILE_PATH = '/video/cat.mp4'
27-
SHOTS_FILE_PATH = '/video/gbikes_dinosaur.mp4'
28-
29-
3022
@pytest.mark.slow
3123
def test_analyze_shots(capsys):
32-
analyze.analyze_shots(
33-
'gs://{}{}'.format(BUCKET, SHOTS_FILE_PATH))
24+
analyze.analyze_shots('gs://demomaker/gbikes_dinosaur.mp4')
3425
out, _ = capsys.readouterr()
3526
assert 'Shot 1:' in out
3627

3728

3829
@pytest.mark.slow
3930
def test_analyze_labels(capsys):
40-
analyze.analyze_labels(
41-
'gs://{}{}'.format(BUCKET, LABELS_FILE_PATH))
31+
analyze.analyze_labels('gs://demomaker/cat.mp4')
4232
out, _ = capsys.readouterr()
4333
assert 'label description: cat' in out
4434

4535

4636
@pytest.mark.slow
4737
def test_analyze_explicit_content(capsys):
48-
analyze.analyze_explicit_content(
49-
'gs://{}{}'.format(BUCKET, EXPLICIT_CONTENT_FILE_PATH))
38+
analyze.analyze_explicit_content('gs://demomaker/cat.mp4')
5039
out, _ = capsys.readouterr()
5140
assert 'pornography' in out

video/cloud-client/analyze/beta_snippets_test.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,14 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
18-
1917
import pytest
2018

2119
import beta_snippets
2220

23-
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
24-
FILE_PATH = 'video/googlework_short.mp4'
25-
2621

2722
@pytest.mark.slow
2823
def test_speech_transcription(capsys):
2924
beta_snippets.speech_transcription(
30-
'gs://{}/{}'.format(BUCKET, FILE_PATH))
25+
'gs://python-docs-samples-tests/video/googlework_short.mp4')
3126
out, _ = capsys.readouterr()
3227
assert 'cultural' in out

video/cloud-client/labels/labels_test.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
18-
1917
import pytest
2018

2119
import labels
2220

2321

24-
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
25-
LABELS_FILE_PATH = '/video/cat.mp4'
26-
27-
2822
@pytest.mark.slow
2923
def test_feline_video_labels(capsys):
30-
labels.analyze_labels(
31-
'gs://{}{}'.format(BUCKET, LABELS_FILE_PATH))
24+
labels.analyze_labels('gs://demomaker/cat.mp4')
3225
out, _ = capsys.readouterr()
3326
assert 'Video label description: cat' in out

video/cloud-client/shotchange/shotchange_test.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,13 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import os
18-
1917
import pytest
2018

2119
import shotchange
2220

23-
BUCKET = os.environ['CLOUD_STORAGE_BUCKET']
24-
SHOTS_FILE_PATH = '/video/gbikes_dinosaur.mp4'
25-
2621

2722
@pytest.mark.slow
2823
def test_shots_dino(capsys):
29-
shotchange.analyze_shots(
30-
'gs://{}{}'.format(BUCKET, SHOTS_FILE_PATH))
24+
shotchange.analyze_shots('gs://demomaker/gbikes_dinosaur.mp4')
3125
out, _ = capsys.readouterr()
3226
assert 'Shot 1:' in out

0 commit comments

Comments
 (0)