Skip to content

Commit

Permalink
chore: refine test cases (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
halajohn committed Jan 26, 2025
1 parent 6eafc31 commit 358090e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@
class DefaultAsyncExtension(AsyncExtension):

async def on_init(self, ten_env: AsyncTenEnv) -> None:
test_prop_json_str = await ten_env.get_property_to_json("test_prop")
test_prop_json_str = await ten_env.get_property_to_json(
"params.billing_type"
)
test_prop_json = json.loads(test_prop_json_str)
assert test_prop_json == 32
assert test_prop_json == "agent_billing"

test_prop_json_str = await ten_env.get_property_to_json()
test_prop_json = json.loads(test_prop_json_str)
assert test_prop_json["test_prop"] == 32
assert test_prop_json["params"]["billing_type"] == "agent_billing"

test_prop_json_str = await ten_env.get_property_to_json("")
test_prop_json = json.loads(test_prop_json_str)
assert test_prop_json["test_prop"] == 32
assert test_prop_json["params"]["billing_type"] == "agent_billing"

async def on_cmd(self, ten_env: AsyncTenEnv, cmd: Cmd) -> None:
# Send a new command to other extensions and wait for the result. The
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
{
"test_prop": 32
"base_url": "xxx",
"api_key": "yyy",
"model": "qwen2.5-duplex-beta250106",
"temperature": 0.8,
"top_p": 0.8,
"prompt_version": "",
"language": "zh-CN",
"max_history": 50,
"force_threshold_ms": 3000,
"vendor": "openai",
"params": {
"billing_type": "agent_billing"
}
}

0 comments on commit 358090e

Please sign in to comment.