#!/usr/bin/python
# -*- coding: utf-8 -*-
import testlink
import pprint
manual = 1  # 手动
automation = 2  # 自动
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
# 连接test link
# url = "http://192.168.68.21/testlink/lib/api/xmlrpc/v1/xmlrpc.php"
# key = "8980b568ad1249e102ce3962a799f742"  # testlink-key

url = 'http://192.168.80.79/testlink/lib/api/xmlrpc/v1/xmlrpc.php'
key = '010599700eb2462891be72799f43e770'

# url = "https://testlink.thiztech.com/testlink/lib/api/xmlrpc/v1/xmlrpc.php"
# key = "34c3194c732457cca2f5b0bfad8b72fe"  # testlink-key
tlc = testlink.TestlinkAPIClient(url, key)

def get_test_suite():
    projects = tlc.getProjects()
    top_suites = tlc.getFirstLevelTestSuitesForTestProject(projects[0]["id"])
    for suite in top_suites:
        print(suite["id"], suite["name"])

get_test_suite()