diff --git a/.chronus/changes/main-2026-0-7-16-58-11.md b/.chronus/changes/main-2026-0-7-16-58-11.md new file mode 100644 index 0000000000..85bbf4b877 --- /dev/null +++ b/.chronus/changes/main-2026-0-7-16-58-11.md @@ -0,0 +1,7 @@ +--- +changeKind: internal +packages: + - "@azure-tools/typespec-python" +--- + +Add testcases for several spector scenarios diff --git a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_special_words_async.py b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_special_words_async.py index 52cc99289e..bc7018ecb1 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_special_words_async.py +++ b/packages/typespec-python/test/azure/mock_api_tests/asynctests/test_special_words_async.py @@ -40,3 +40,21 @@ async def test_model(client: SpecialWordsClient, special_words): @pytest.mark.asyncio async def test_model_properties(client: SpecialWordsClient): await client.model_properties.same_as_model(models.SameAsModel(same_as_model="ok")) + + +@pytest.mark.asyncio +async def test_model_properties_dict_methods(client: SpecialWordsClient): + await client.model_properties.dict_methods( + body=models.DictMethods( + keys_property="ok", + items_property="ok", + values_property="ok", + popitem_property="ok", + clear_property="ok", + update_property="ok", + setdefault_property="ok", + pop_property="ok", + get_property="ok", + copy_property="ok", + ) + ) diff --git a/packages/typespec-python/test/azure/mock_api_tests/test_special_words.py b/packages/typespec-python/test/azure/mock_api_tests/test_special_words.py index 2b4dcb7491..7672f9cd5d 100644 --- a/packages/typespec-python/test/azure/mock_api_tests/test_special_words.py +++ b/packages/typespec-python/test/azure/mock_api_tests/test_special_words.py @@ -35,3 +35,20 @@ def test_model(client: SpecialWordsClient, special_words): def test_model_properties(client: SpecialWordsClient): client.model_properties.same_as_model(models.SameAsModel(same_as_model="ok")) + + +def test_model_properties_dict_methods(client: SpecialWordsClient): + client.model_properties.dict_methods( + body=models.DictMethods( + keys_property="ok", + items_property="ok", + values_property="ok", + popitem_property="ok", + clear_property="ok", + update_property="ok", + setdefault_property="ok", + pop_property="ok", + get_property="ok", + copy_property="ok", + ) + )