From d8563826917b4500216ffe73f9037eef95c7cd44 Mon Sep 17 00:00:00 2001 From: Jon Wayne Parrott Date: Wed, 5 Apr 2017 15:21:33 -0700 Subject: [PATCH] Remove resource [(#890)](https://github.com/GoogleCloudPlatform/python-docs-samples/issues/890) * Remove resource fixture * Remove remote resource --- .../samples/snippets/transcribe_async_test.py | 10 +++++++--- .../samples/snippets/transcribe_streaming_test.py | 8 ++++++-- .../samples/snippets/transcribe_test.py | 9 ++++++--- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/packages/google-cloud-speech/samples/snippets/transcribe_async_test.py b/packages/google-cloud-speech/samples/snippets/transcribe_async_test.py index 6142d43db96b..7d66747eb446 100644 --- a/packages/google-cloud-speech/samples/snippets/transcribe_async_test.py +++ b/packages/google-cloud-speech/samples/snippets/transcribe_async_test.py @@ -11,19 +11,23 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import re import transcribe_async +RESOURCES = os.path.join(os.path.dirname(__file__), 'resources') -def test_transcribe(resource, capsys): - transcribe_async.transcribe_file(resource('audio.raw')) + +def test_transcribe(capsys): + transcribe_async.transcribe_file( + os.path.join(RESOURCES, 'audio.raw')) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I) -def test_transcribe_gcs(resource, capsys): +def test_transcribe_gcs(capsys): transcribe_async.transcribe_gcs( 'gs://python-docs-samples-tests/speech/audio.flac') out, err = capsys.readouterr() diff --git a/packages/google-cloud-speech/samples/snippets/transcribe_streaming_test.py b/packages/google-cloud-speech/samples/snippets/transcribe_streaming_test.py index bd3f5cb59a81..2b3ca8ee5c0b 100644 --- a/packages/google-cloud-speech/samples/snippets/transcribe_streaming_test.py +++ b/packages/google-cloud-speech/samples/snippets/transcribe_streaming_test.py @@ -11,13 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import re import transcribe_streaming +RESOURCES = os.path.join(os.path.dirname(__file__), 'resources') -def test_transcribe_streaming(resource, capsys): - transcribe_streaming.transcribe_streaming(resource('audio.raw')) + +def test_transcribe_streaming(capsys): + transcribe_streaming.transcribe_streaming( + os.path.join(RESOURCES, 'audio.raw')) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I) diff --git a/packages/google-cloud-speech/samples/snippets/transcribe_test.py b/packages/google-cloud-speech/samples/snippets/transcribe_test.py index 5940fc7f9862..d1e9f6338ea6 100644 --- a/packages/google-cloud-speech/samples/snippets/transcribe_test.py +++ b/packages/google-cloud-speech/samples/snippets/transcribe_test.py @@ -11,19 +11,22 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os import re import transcribe +RESOURCES = os.path.join(os.path.dirname(__file__), 'resources') -def test_transcribe_file(resource, capsys): - transcribe.transcribe_file(resource('audio.raw')) + +def test_transcribe_file(capsys): + transcribe.transcribe_file(os.path.join(RESOURCES, 'audio.raw')) out, err = capsys.readouterr() assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I) -def test_transcribe_gcs(resource, capsys): +def test_transcribe_gcs(capsys): transcribe.transcribe_gcs( 'gs://python-docs-samples-tests/speech/audio.flac') out, err = capsys.readouterr()