Skip to content

Commit b7e7aab

Browse files
alixhamidanoscarmike
authored andcommitted
Use explicit URIs for Video Intelligence sample tests [(#1743)](#1743)
1 parent dca721d commit b7e7aab

File tree

2 files changed

+4
-20
lines changed

2 files changed

+4
-20
lines changed

videointelligence/samples/analyze/analyze_test.py

Lines changed: 3 additions & 14 deletions
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

videointelligence/samples/analyze/beta_snippets_test.py

Lines changed: 1 addition & 6 deletions
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

0 commit comments

Comments
 (0)