Skip to content

Commit

Permalink
Remove resource [(#890)](#890)
Browse files Browse the repository at this point in the history
* Remove resource fixture

* Remove remote resource
  • Loading branch information
Jon Wayne Parrott authored and dandhlee committed Feb 9, 2023
1 parent b362601 commit f155170
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
10 changes: 7 additions & 3 deletions speech/snippets/transcribe_async_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 6 additions & 2 deletions speech/snippets/transcribe_streaming_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
9 changes: 6 additions & 3 deletions speech/snippets/transcribe_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit f155170

Please sign in to comment.