File tree Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Expand file tree Collapse file tree 3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 1111# See the License for the specific language governing permissions and
1212# limitations under the License.
1313
14+ import os
1415import re
1516
1617import 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 ()
Original file line number Diff line number Diff line change 1111# See the License for the specific language governing permissions and
1212# limitations under the License.
1313
14+ import os
1415import re
1516
1617import 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 )
Original file line number Diff line number Diff line change 1111# See the License for the specific language governing permissions and
1212# limitations under the License.
1313
14+ import os
1415import re
1516
1617import 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 ()
You can’t perform that action at this time.
0 commit comments