Skip to content

Commit 87f93ee

Browse files
author
Jon Wayne Parrott
authored
* Remove resource fixture * Remove remote resource
1 parent 8da6d1d commit 87f93ee

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

samples/snippets/transcribe_async_test.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
import os
1415
import re
1516

1617
import transcribe_async
1718

19+
RESOURCES = os.path.join(os.path.dirname(__file__), 'resources')
1820

19-
def test_transcribe(resource, capsys):
20-
transcribe_async.transcribe_file(resource('audio.raw'))
21+
22+
def test_transcribe(capsys):
23+
transcribe_async.transcribe_file(
24+
os.path.join(RESOURCES, 'audio.raw'))
2125
out, err = capsys.readouterr()
2226

2327
assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)
2428

2529

26-
def test_transcribe_gcs(resource, capsys):
30+
def test_transcribe_gcs(capsys):
2731
transcribe_async.transcribe_gcs(
2832
'gs://python-docs-samples-tests/speech/audio.flac')
2933
out, err = capsys.readouterr()

samples/snippets/transcribe_streaming_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
import os
1415
import re
1516

1617
import transcribe_streaming
1718

19+
RESOURCES = os.path.join(os.path.dirname(__file__), 'resources')
1820

19-
def test_transcribe_streaming(resource, capsys):
20-
transcribe_streaming.transcribe_streaming(resource('audio.raw'))
21+
22+
def test_transcribe_streaming(capsys):
23+
transcribe_streaming.transcribe_streaming(
24+
os.path.join(RESOURCES, 'audio.raw'))
2125
out, err = capsys.readouterr()
2226

2327
assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)

samples/snippets/transcribe_test.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,22 @@
1111
# See the License for the specific language governing permissions and
1212
# limitations under the License.
1313

14+
import os
1415
import re
1516

1617
import transcribe
1718

19+
RESOURCES = os.path.join(os.path.dirname(__file__), 'resources')
1820

19-
def test_transcribe_file(resource, capsys):
20-
transcribe.transcribe_file(resource('audio.raw'))
21+
22+
def test_transcribe_file(capsys):
23+
transcribe.transcribe_file(os.path.join(RESOURCES, 'audio.raw'))
2124
out, err = capsys.readouterr()
2225

2326
assert re.search(r'how old is the Brooklyn Bridge', out, re.DOTALL | re.I)
2427

2528

26-
def test_transcribe_gcs(resource, capsys):
29+
def test_transcribe_gcs(capsys):
2730
transcribe.transcribe_gcs(
2831
'gs://python-docs-samples-tests/speech/audio.flac')
2932
out, err = capsys.readouterr()

0 commit comments

Comments
 (0)