File tree Expand file tree Collapse file tree 3 files changed +13
-6
lines changed
Expand file tree Collapse file tree 3 files changed +13
-6
lines changed Original file line number Diff line number Diff line change 11from typing import BinaryIO , List , Optional
2+ from urllib .parse import urlencode
23
34import httpx
45
@@ -142,9 +143,11 @@ def word_search(
142143) -> types .WordSearchMatchResponse :
143144 response = client .get (
144145 f"/transcript/{ transcript_id } /word-search" ,
145- params = {
146- "words" : words ,
147- },
146+ params = urlencode (
147+ {
148+ "words" : "," .join (words ),
149+ }
150+ ),
148151 )
149152
150153 if response .status_code != httpx .codes .ok :
Original file line number Diff line number Diff line change 77
88setup (
99 name = "assemblyai" ,
10- version = "0.5.0 " ,
10+ version = "0.5.1 " ,
1111 description = "AssemblyAI Python SDK" ,
1212 author = "AssemblyAI" ,
1313 author_email = "engineering.sdk@assemblyai.com" ,
Original file line number Diff line number Diff line change 11from typing import Any , Dict , List
2+ from urllib .parse import urlencode
23
34import httpx
45import pytest
@@ -114,9 +115,12 @@ def test_word_search_succeeds(httpx_mock: HTTPXMock):
114115 factories .WordSearchMatchResponseFactory
115116 )()
116117
118+ search_words = {
119+ "words" : "," .join (["test" , "me" ]),
120+ }
117121 # mock the specific endpoints
118122 url = httpx .URL (
119- f"{ aai .settings .base_url } /transcript/{ transcript .id } /word-search?words=test " ,
123+ f"{ aai .settings .base_url } /transcript/{ transcript .id } /word-search?{ urlencode ( search_words ) } " ,
120124 )
121125
122126 httpx_mock .add_response (
@@ -127,7 +131,7 @@ def test_word_search_succeeds(httpx_mock: HTTPXMock):
127131 )
128132
129133 # mimic the SDK call
130- matches = transcript .word_search (words = ["test" ])
134+ matches = transcript .word_search (words = ["test" , "me" ])
131135
132136 # check integrity of the response
133137
You can’t perform that action at this time.
0 commit comments