def test_list_organizations():
responses.add(responses.GET, "https://app.threatstack.com/api/v1/organizations",
content_type="application/json",
body='[ \
{"role": "user", "id": "acbd18db4cc2f85cedef654fccc4a4d8", "name": "Foo\'s Organization"}, \
{"role": "user", "id": "37b51d194a7513e45b56f6524f2d51f2", "name": "Bar\'s Organization"} \
]'
)
ts = ThreatStack(api_key="test_api_key", api_version=1)
response = ts.organizations.list()
assert isinstance(response, GeneratorType)
count = 0
for org in response:
count += 1
assert count == 2
test_organizations.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录