File tree 3 files changed +19
-8
lines changed
3 files changed +19
-8
lines changed Original file line number Diff line number Diff line change 11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
14
+ import os
14
15
import re
15
16
16
17
import transcribe_async
17
18
19
+ RESOURCES = os .path .join (os .path .dirname (__file__ ), 'resources' )
18
20
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' ))
21
25
out , err = capsys .readouterr ()
22
26
23
27
assert re .search (r'how old is the Brooklyn Bridge' , out , re .DOTALL | re .I )
24
28
25
29
26
- def test_transcribe_gcs (resource , capsys ):
30
+ def test_transcribe_gcs (capsys ):
27
31
transcribe_async .transcribe_gcs (
28
32
'gs://python-docs-samples-tests/speech/audio.flac' )
29
33
out , err = capsys .readouterr ()
Original file line number Diff line number Diff line change 11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
14
+ import os
14
15
import re
15
16
16
17
import transcribe_streaming
17
18
19
+ RESOURCES = os .path .join (os .path .dirname (__file__ ), 'resources' )
18
20
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' ))
21
25
out , err = capsys .readouterr ()
22
26
23
27
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 11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
14
+ import os
14
15
import re
15
16
16
17
import transcribe
17
18
19
+ RESOURCES = os .path .join (os .path .dirname (__file__ ), 'resources' )
18
20
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' ))
21
24
out , err = capsys .readouterr ()
22
25
23
26
assert re .search (r'how old is the Brooklyn Bridge' , out , re .DOTALL | re .I )
24
27
25
28
26
- def test_transcribe_gcs (resource , capsys ):
29
+ def test_transcribe_gcs (capsys ):
27
30
transcribe .transcribe_gcs (
28
31
'gs://python-docs-samples-tests/speech/audio.flac' )
29
32
out , err = capsys .readouterr ()
You can’t perform that action at this time.
0 commit comments