Skip to main content
Glama
test_broker_api.py1.27 kB
"""E2E tests for broker-related APIs.""" import pytest from utils.api_client import TWSEAPIClient class TestBrokerServiceAPIs: """券商服務相關 APIs 測試.""" @pytest.mark.parametrize("endpoint", [ "/brokerService/secRegData", "/brokerService/brokerList", ]) def test_broker_service_apis_have_basic_fields(self, endpoint): """測試券商服務相關 APIs 都有基本欄位.""" data = TWSEAPIClient.get_data(endpoint) first_item = data[0] # 確保至少有基本欄位存在 assert len(first_item) > 0, f"{endpoint} 應該至少包含一些欄位" class TestBrokerDataAPIs: """券商資料相關 APIs 測試.""" @pytest.mark.parametrize("endpoint", [ "/opendata/t187ap01", "/opendata/t187ap20", "/opendata/t187ap21", "/opendata/t187ap18", "/opendata/OpenData_BRK01", "/opendata/OpenData_BRK02", ]) def test_broker_data_apis_have_basic_fields(self, endpoint): """測試券商資料相關 APIs 都有基本欄位.""" data = TWSEAPIClient.get_data(endpoint) first_item = data[0] # 確保至少有基本欄位存在 assert len(first_item) > 0, f"{endpoint} 應該至少包含一些欄位"

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/twjackysu/TWSEMCPServer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server