File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
videointelligence/samples/analyze Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17- import os
18-
1917import pytest
2018
2119import 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
3123def 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
3930def 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
4737def 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
Original file line number Diff line number Diff line change 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17- import os
18-
1917import pytest
2018
2119import beta_snippets
2220
23- BUCKET = os .environ ['CLOUD_STORAGE_BUCKET' ]
24- FILE_PATH = 'video/googlework_short.mp4'
25-
2621
2722@pytest .mark .slow
2823def 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
You can’t perform that action at this time.
0 commit comments