1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787
|
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# Generated file, DO NOT EDIT
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------------------------
from msrest import Serializer, Deserializer
from ...client import Client
from . import models
class TestClient(Client):
"""Test
:param str base_url: Service URL
:param Authentication creds: Authenticated credentials.
"""
def __init__(self, base_url=None, creds=None):
super(TestClient, self).__init__(base_url, creds)
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)
resource_area_identifier = 'c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e'
def get_action_results(self, project, run_id, test_case_result_id, iteration_id, action_path=None):
"""GetActionResults.
Gets the action results for an iteration in a test result.
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result that contains the iterations.
:param int iteration_id: ID of the iteration that contains the actions.
:param str action_path: Path of a specific action, used to get just that action.
:rtype: [TestActionResultModel]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if iteration_id is not None:
route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int')
if action_path is not None:
route_values['actionPath'] = self._serialize.url('action_path', action_path, 'str')
response = self._send(http_method='GET',
location_id='eaf40c31-ff84-4062-aafd-d5664be11a37',
version='5.0',
route_values=route_values)
return self._deserialize('[TestActionResultModel]', self._unwrap_collection(response))
def create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id):
"""CreateTestResultAttachment.
[Preview API] Attach a file to a test result.
:param :class:`<TestAttachmentRequestModel> <azure.devops.v5_0.test.models.TestAttachmentRequestModel>` attachment_request_model: Attachment details TestAttachmentRequestModel
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result against which attachment has to be uploaded.
:rtype: :class:`<TestAttachmentReference> <azure.devops.v5_0.test.models.TestAttachmentReference>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel')
response = self._send(http_method='POST',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestAttachmentReference', response)
def create_test_sub_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id, test_sub_result_id):
"""CreateTestSubResultAttachment.
[Preview API] Attach a file to a test result
:param :class:`<TestAttachmentRequestModel> <azure.devops.v5_0.test.models.TestAttachmentRequestModel>` attachment_request_model: Attachment Request Model.
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test results that contains sub result.
:param int test_sub_result_id: ID of the test sub results against which attachment has to be uploaded.
:rtype: :class:`<TestAttachmentReference> <azure.devops.v5_0.test.models.TestAttachmentReference>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
query_parameters = {}
if test_sub_result_id is not None:
query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int')
content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel')
response = self._send(http_method='POST',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters,
content=content)
return self._deserialize('TestAttachmentReference', response)
def get_test_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, **kwargs):
"""GetTestResultAttachmentContent.
[Preview API] Download a test result attachment by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the testCaseResultId.
:param int test_case_result_id: ID of the test result whose attachment has to be downloaded.
:param int attachment_id: ID of the test result attachment to be downloaded.
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
accept_media_type='application/octet-stream')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def get_test_result_attachments(self, project, run_id, test_case_result_id):
"""GetTestResultAttachments.
[Preview API] Get list of test result attachments reference.
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result.
:rtype: [TestAttachment]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values)
return self._deserialize('[TestAttachment]', self._unwrap_collection(response))
def get_test_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, **kwargs):
"""GetTestResultAttachmentZip.
[Preview API] Download a test result attachment by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the testCaseResultId.
:param int test_case_result_id: ID of the test result whose attachment has to be downloaded.
:param int attachment_id: ID of the test result attachment to be downloaded.
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
accept_media_type='application/zip')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def get_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs):
"""GetTestSubResultAttachmentContent.
[Preview API] Download a test sub result attachment
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test results that contains sub result.
:param int attachment_id: ID of the test result attachment to be downloaded
:param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
query_parameters = {}
if test_sub_result_id is not None:
query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters,
accept_media_type='application/octet-stream')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def get_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id):
"""GetTestSubResultAttachments.
[Preview API] Get list of test sub result attachments
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test results that contains sub result.
:param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded
:rtype: [TestAttachment]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
query_parameters = {}
if test_sub_result_id is not None:
query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestAttachment]', self._unwrap_collection(response))
def get_test_sub_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs):
"""GetTestSubResultAttachmentZip.
[Preview API] Download a test sub result attachment
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test results that contains sub result.
:param int attachment_id: ID of the test result attachment to be downloaded
:param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
query_parameters = {}
if test_sub_result_id is not None:
query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int')
response = self._send(http_method='GET',
location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters,
accept_media_type='application/zip')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def create_test_run_attachment(self, attachment_request_model, project, run_id):
"""CreateTestRunAttachment.
[Preview API] Attach a file to a test run.
:param :class:`<TestAttachmentRequestModel> <azure.devops.v5_0.test.models.TestAttachmentRequestModel>` attachment_request_model: Attachment details TestAttachmentRequestModel
:param str project: Project ID or project name
:param int run_id: ID of the test run against which attachment has to be uploaded.
:rtype: :class:`<TestAttachmentReference> <azure.devops.v5_0.test.models.TestAttachmentReference>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel')
response = self._send(http_method='POST',
location_id='4f004af4-a507-489c-9b13-cb62060beb11',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestAttachmentReference', response)
def get_test_run_attachment_content(self, project, run_id, attachment_id, **kwargs):
"""GetTestRunAttachmentContent.
[Preview API] Download a test run attachment by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the test run whose attachment has to be downloaded.
:param int attachment_id: ID of the test run attachment to be downloaded.
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
response = self._send(http_method='GET',
location_id='4f004af4-a507-489c-9b13-cb62060beb11',
version='5.0-preview.1',
route_values=route_values,
accept_media_type='application/octet-stream')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def get_test_run_attachments(self, project, run_id):
"""GetTestRunAttachments.
[Preview API] Get list of test run attachments reference.
:param str project: Project ID or project name
:param int run_id: ID of the test run.
:rtype: [TestAttachment]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
response = self._send(http_method='GET',
location_id='4f004af4-a507-489c-9b13-cb62060beb11',
version='5.0-preview.1',
route_values=route_values)
return self._deserialize('[TestAttachment]', self._unwrap_collection(response))
def get_test_run_attachment_zip(self, project, run_id, attachment_id, **kwargs):
"""GetTestRunAttachmentZip.
[Preview API] Download a test run attachment by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the test run whose attachment has to be downloaded.
:param int attachment_id: ID of the test run attachment to be downloaded.
:rtype: object
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if attachment_id is not None:
route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int')
response = self._send(http_method='GET',
location_id='4f004af4-a507-489c-9b13-cb62060beb11',
version='5.0-preview.1',
route_values=route_values,
accept_media_type='application/zip')
if "callback" in kwargs:
callback = kwargs["callback"]
else:
callback = None
return self._client.stream_download(response, callback=callback)
def get_clone_information(self, project, clone_operation_id, include_details=None):
"""GetCloneInformation.
[Preview API] Get clone information.
:param str project: Project ID or project name
:param int clone_operation_id: Operation ID returned when we queue a clone operation
:param bool include_details: If false returns only status of the clone operation information, if true returns complete clone information
:rtype: :class:`<CloneOperationInformation> <azure.devops.v5_0.test.models.CloneOperationInformation>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if clone_operation_id is not None:
route_values['cloneOperationId'] = self._serialize.url('clone_operation_id', clone_operation_id, 'int')
query_parameters = {}
if include_details is not None:
query_parameters['$includeDetails'] = self._serialize.query('include_details', include_details, 'bool')
response = self._send(http_method='GET',
location_id='5b9d6320-abed-47a5-a151-cd6dc3798be6',
version='5.0-preview.2',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('CloneOperationInformation', response)
def clone_test_plan(self, clone_request_body, project, plan_id):
"""CloneTestPlan.
[Preview API] Clone test plan
:param :class:`<TestPlanCloneRequest> <azure.devops.v5_0.test.models.TestPlanCloneRequest>` clone_request_body: Plan Clone Request Body detail TestPlanCloneRequest
:param str project: Project ID or project name
:param int plan_id: ID of the test plan to be cloned.
:rtype: :class:`<CloneOperationInformation> <azure.devops.v5_0.test.models.CloneOperationInformation>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
content = self._serialize.body(clone_request_body, 'TestPlanCloneRequest')
response = self._send(http_method='POST',
location_id='edc3ef4b-8460-4e86-86fa-8e4f5e9be831',
version='5.0-preview.2',
route_values=route_values,
content=content)
return self._deserialize('CloneOperationInformation', response)
def clone_test_suite(self, clone_request_body, project, plan_id, source_suite_id):
"""CloneTestSuite.
[Preview API] Clone test suite
:param :class:`<TestSuiteCloneRequest> <azure.devops.v5_0.test.models.TestSuiteCloneRequest>` clone_request_body: Suite Clone Request Body detail TestSuiteCloneRequest
:param str project: Project ID or project name
:param int plan_id: ID of the test plan in which suite to be cloned is present
:param int source_suite_id: ID of the test suite to be cloned
:rtype: :class:`<CloneOperationInformation> <azure.devops.v5_0.test.models.CloneOperationInformation>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if source_suite_id is not None:
route_values['sourceSuiteId'] = self._serialize.url('source_suite_id', source_suite_id, 'int')
content = self._serialize.body(clone_request_body, 'TestSuiteCloneRequest')
response = self._send(http_method='POST',
location_id='751e4ab5-5bf6-4fb5-9d5d-19ef347662dd',
version='5.0-preview.2',
route_values=route_values,
content=content)
return self._deserialize('CloneOperationInformation', response)
def get_build_code_coverage(self, project, build_id, flags):
"""GetBuildCodeCoverage.
[Preview API] Get code coverage data for a build.
:param str project: Project ID or project name
:param int build_id: ID of the build for which code coverage data needs to be fetched.
:param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData.
:rtype: [BuildCoverage]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if build_id is not None:
query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int')
if flags is not None:
query_parameters['flags'] = self._serialize.query('flags', flags, 'int')
response = self._send(http_method='GET',
location_id='77560e8a-4e8c-4d59-894e-a5f264c24444',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[BuildCoverage]', self._unwrap_collection(response))
def get_test_run_code_coverage(self, project, run_id, flags):
"""GetTestRunCodeCoverage.
[Preview API] Get code coverage data for a test run
:param str project: Project ID or project name
:param int run_id: ID of the test run for which code coverage data needs to be fetched.
:param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData.
:rtype: [TestRunCoverage]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
query_parameters = {}
if flags is not None:
query_parameters['flags'] = self._serialize.query('flags', flags, 'int')
response = self._send(http_method='GET',
location_id='9629116f-3b89-4ed8-b358-d4694efda160',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestRunCoverage]', self._unwrap_collection(response))
def create_test_configuration(self, test_configuration, project):
"""CreateTestConfiguration.
[Preview API] Create a test configuration
:param :class:`<TestConfiguration> <azure.devops.v5_0.test.models.TestConfiguration>` test_configuration: Test configuration
:param str project: Project ID or project name
:rtype: :class:`<TestConfiguration> <azure.devops.v5_0.test.models.TestConfiguration>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(test_configuration, 'TestConfiguration')
response = self._send(http_method='POST',
location_id='d667591b-b9fd-4263-997a-9a084cca848f',
version='5.0-preview.2',
route_values=route_values,
content=content)
return self._deserialize('TestConfiguration', response)
def delete_test_configuration(self, project, test_configuration_id):
"""DeleteTestConfiguration.
[Preview API] Delete a test configuration
:param str project: Project ID or project name
:param int test_configuration_id: ID of the test configuration to get.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_configuration_id is not None:
route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int')
self._send(http_method='DELETE',
location_id='d667591b-b9fd-4263-997a-9a084cca848f',
version='5.0-preview.2',
route_values=route_values)
def get_test_configuration_by_id(self, project, test_configuration_id):
"""GetTestConfigurationById.
[Preview API] Get a test configuration
:param str project: Project ID or project name
:param int test_configuration_id: ID of the test configuration to get.
:rtype: :class:`<TestConfiguration> <azure.devops.v5_0.test.models.TestConfiguration>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_configuration_id is not None:
route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int')
response = self._send(http_method='GET',
location_id='d667591b-b9fd-4263-997a-9a084cca848f',
version='5.0-preview.2',
route_values=route_values)
return self._deserialize('TestConfiguration', response)
def get_test_configurations(self, project, skip=None, top=None, continuation_token=None, include_all_properties=None):
"""GetTestConfigurations.
[Preview API] Get a list of test configurations
:param str project: Project ID or project name
:param int skip: Number of test configurations to skip.
:param int top: Number of test configurations to return.
:param str continuation_token: If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations.
:param bool include_all_properties: If true, it returns all properties of the test configurations. Otherwise, it returns the skinny version.
:rtype: [TestConfiguration]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
if continuation_token is not None:
query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str')
if include_all_properties is not None:
query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool')
response = self._send(http_method='GET',
location_id='d667591b-b9fd-4263-997a-9a084cca848f',
version='5.0-preview.2',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestConfiguration]', self._unwrap_collection(response))
def update_test_configuration(self, test_configuration, project, test_configuration_id):
"""UpdateTestConfiguration.
[Preview API] Update a test configuration
:param :class:`<TestConfiguration> <azure.devops.v5_0.test.models.TestConfiguration>` test_configuration: Test configuration
:param str project: Project ID or project name
:param int test_configuration_id: ID of the test configuration to update.
:rtype: :class:`<TestConfiguration> <azure.devops.v5_0.test.models.TestConfiguration>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_configuration_id is not None:
route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int')
content = self._serialize.body(test_configuration, 'TestConfiguration')
response = self._send(http_method='PATCH',
location_id='d667591b-b9fd-4263-997a-9a084cca848f',
version='5.0-preview.2',
route_values=route_values,
content=content)
return self._deserialize('TestConfiguration', response)
def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, include_action_results=None):
"""GetTestIteration.
Get iteration for a result
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result that contains the iterations.
:param int iteration_id: Id of the test results Iteration.
:param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration.
:rtype: :class:`<TestIterationDetailsModel> <azure.devops.v5_0.test.models.TestIterationDetailsModel>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if iteration_id is not None:
route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int')
query_parameters = {}
if include_action_results is not None:
query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool')
response = self._send(http_method='GET',
location_id='73eb9074-3446-4c44-8296-2f811950ff8d',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('TestIterationDetailsModel', response)
def get_test_iterations(self, project, run_id, test_case_result_id, include_action_results=None):
"""GetTestIterations.
Get iterations for a result
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result that contains the iterations.
:param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration.
:rtype: [TestIterationDetailsModel]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
query_parameters = {}
if include_action_results is not None:
query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool')
response = self._send(http_method='GET',
location_id='73eb9074-3446-4c44-8296-2f811950ff8d',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestIterationDetailsModel]', self._unwrap_collection(response))
def get_result_parameters(self, project, run_id, test_case_result_id, iteration_id, param_name=None):
"""GetResultParameters.
Get a list of parameterized results
:param str project: Project ID or project name
:param int run_id: ID of the test run that contains the result.
:param int test_case_result_id: ID of the test result that contains the iterations.
:param int iteration_id: ID of the iteration that contains the parameterized results.
:param str param_name: Name of the parameter.
:rtype: [TestResultParameterModel]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
if iteration_id is not None:
route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int')
query_parameters = {}
if param_name is not None:
query_parameters['paramName'] = self._serialize.query('param_name', param_name, 'str')
response = self._send(http_method='GET',
location_id='7c69810d-3354-4af3-844a-180bd25db08a',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestResultParameterModel]', self._unwrap_collection(response))
def create_test_plan(self, test_plan, project):
"""CreateTestPlan.
Create a test plan.
:param :class:`<PlanUpdateModel> <azure.devops.v5_0.test.models.PlanUpdateModel>` test_plan: A test plan object.
:param str project: Project ID or project name
:rtype: :class:`<TestPlan> <azure.devops.v5_0.test.models.TestPlan>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(test_plan, 'PlanUpdateModel')
response = self._send(http_method='POST',
location_id='51712106-7278-4208-8563-1c96f40cf5e4',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('TestPlan', response)
def delete_test_plan(self, project, plan_id):
"""DeleteTestPlan.
Delete a test plan.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan to be deleted.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
self._send(http_method='DELETE',
location_id='51712106-7278-4208-8563-1c96f40cf5e4',
version='5.0',
route_values=route_values)
def get_plan_by_id(self, project, plan_id):
"""GetPlanById.
Get test plan by ID.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan to return.
:rtype: :class:`<TestPlan> <azure.devops.v5_0.test.models.TestPlan>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
response = self._send(http_method='GET',
location_id='51712106-7278-4208-8563-1c96f40cf5e4',
version='5.0',
route_values=route_values)
return self._deserialize('TestPlan', response)
def get_plans(self, project, owner=None, skip=None, top=None, include_plan_details=None, filter_active_plans=None):
"""GetPlans.
Get a list of test plans.
:param str project: Project ID or project name
:param str owner: Filter for test plan by owner ID or name.
:param int skip: Number of test plans to skip.
:param int top: Number of test plans to return.
:param bool include_plan_details: Get all properties of the test plan.
:param bool filter_active_plans: Get just the active plans.
:rtype: [TestPlan]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if owner is not None:
query_parameters['owner'] = self._serialize.query('owner', owner, 'str')
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
if include_plan_details is not None:
query_parameters['includePlanDetails'] = self._serialize.query('include_plan_details', include_plan_details, 'bool')
if filter_active_plans is not None:
query_parameters['filterActivePlans'] = self._serialize.query('filter_active_plans', filter_active_plans, 'bool')
response = self._send(http_method='GET',
location_id='51712106-7278-4208-8563-1c96f40cf5e4',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestPlan]', self._unwrap_collection(response))
def update_test_plan(self, plan_update_model, project, plan_id):
"""UpdateTestPlan.
Update a test plan.
:param :class:`<PlanUpdateModel> <azure.devops.v5_0.test.models.PlanUpdateModel>` plan_update_model:
:param str project: Project ID or project name
:param int plan_id: ID of the test plan to be updated.
:rtype: :class:`<TestPlan> <azure.devops.v5_0.test.models.TestPlan>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
content = self._serialize.body(plan_update_model, 'PlanUpdateModel')
response = self._send(http_method='PATCH',
location_id='51712106-7278-4208-8563-1c96f40cf5e4',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('TestPlan', response)
def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None):
"""GetPoint.
Get a test point.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan.
:param int suite_id: ID of the suite that contains the point.
:param int point_ids: ID of the test point to get.
:param str wit_fields: Comma-separated list of work item field names.
:rtype: :class:`<TestPoint> <azure.devops.v5_0.test.models.TestPoint>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if point_ids is not None:
route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'int')
query_parameters = {}
if wit_fields is not None:
query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str')
response = self._send(http_method='GET',
location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('TestPoint', response)
def get_points(self, project, plan_id, suite_id, wit_fields=None, configuration_id=None, test_case_id=None, test_point_ids=None, include_point_details=None, skip=None, top=None):
"""GetPoints.
Get a list of test points.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan.
:param int suite_id: ID of the suite that contains the points.
:param str wit_fields: Comma-separated list of work item field names.
:param str configuration_id: Get test points for specific configuration.
:param str test_case_id: Get test points for a specific test case, valid when configurationId is not set.
:param str test_point_ids: Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set.
:param bool include_point_details: Include all properties for the test point.
:param int skip: Number of test points to skip..
:param int top: Number of test points to return.
:rtype: [TestPoint]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
query_parameters = {}
if wit_fields is not None:
query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str')
if configuration_id is not None:
query_parameters['configurationId'] = self._serialize.query('configuration_id', configuration_id, 'str')
if test_case_id is not None:
query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str')
if test_point_ids is not None:
query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str')
if include_point_details is not None:
query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool')
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
response = self._send(http_method='GET',
location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestPoint]', self._unwrap_collection(response))
def update_test_points(self, point_update_model, project, plan_id, suite_id, point_ids):
"""UpdateTestPoints.
Update test points.
:param :class:`<PointUpdateModel> <azure.devops.v5_0.test.models.PointUpdateModel>` point_update_model: Data to update.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan.
:param int suite_id: ID of the suite that contains the points.
:param str point_ids: ID of the test point to get. Use a comma-separated list of IDs to update multiple test points.
:rtype: [TestPoint]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if point_ids is not None:
route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'str')
content = self._serialize.body(point_update_model, 'PointUpdateModel')
response = self._send(http_method='PATCH',
location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('[TestPoint]', self._unwrap_collection(response))
def get_points_by_query(self, query, project, skip=None, top=None):
"""GetPointsByQuery.
[Preview API] Get test points using query.
:param :class:`<TestPointsQuery> <azure.devops.v5_0.test.models.TestPointsQuery>` query: TestPointsQuery to get test points.
:param str project: Project ID or project name
:param int skip: Number of test points to skip..
:param int top: Number of test points to return.
:rtype: :class:`<TestPointsQuery> <azure.devops.v5_0.test.models.TestPointsQuery>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
content = self._serialize.body(query, 'TestPointsQuery')
response = self._send(http_method='POST',
location_id='b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce',
version='5.0-preview.2',
route_values=route_values,
query_parameters=query_parameters,
content=content)
return self._deserialize('TestPointsQuery', response)
def get_result_retention_settings(self, project):
"""GetResultRetentionSettings.
[Preview API] Get test result retention settings
:param str project: Project ID or project name
:rtype: :class:`<ResultRetentionSettings> <azure.devops.v5_0.test.models.ResultRetentionSettings>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
response = self._send(http_method='GET',
location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde',
version='5.0-preview.1',
route_values=route_values)
return self._deserialize('ResultRetentionSettings', response)
def update_result_retention_settings(self, retention_settings, project):
"""UpdateResultRetentionSettings.
[Preview API] Update test result retention settings
:param :class:`<ResultRetentionSettings> <azure.devops.v5_0.test.models.ResultRetentionSettings>` retention_settings: Test result retention settings details to be updated
:param str project: Project ID or project name
:rtype: :class:`<ResultRetentionSettings> <azure.devops.v5_0.test.models.ResultRetentionSettings>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(retention_settings, 'ResultRetentionSettings')
response = self._send(http_method='PATCH',
location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('ResultRetentionSettings', response)
def add_test_results_to_test_run(self, results, project, run_id):
"""AddTestResultsToTestRun.
Add test results to a test run.
:param [TestCaseResult] results: List of test results to add.
:param str project: Project ID or project name
:param int run_id: Test run ID into which test results to add.
:rtype: [TestCaseResult]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
content = self._serialize.body(results, '[TestCaseResult]')
response = self._send(http_method='POST',
location_id='4637d869-3a76-4468-8057-0bb02aa385cf',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('[TestCaseResult]', self._unwrap_collection(response))
def get_test_result_by_id(self, project, run_id, test_case_result_id, details_to_include=None):
"""GetTestResultById.
Get a test result for a test run.
:param str project: Project ID or project name
:param int run_id: Test run ID of a test result to fetch.
:param int test_case_result_id: Test result ID.
:param str details_to_include: Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults.
:rtype: :class:`<TestCaseResult> <azure.devops.v5_0.test.models.TestCaseResult>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
if test_case_result_id is not None:
route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int')
query_parameters = {}
if details_to_include is not None:
query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str')
response = self._send(http_method='GET',
location_id='4637d869-3a76-4468-8057-0bb02aa385cf',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('TestCaseResult', response)
def get_test_results(self, project, run_id, details_to_include=None, skip=None, top=None, outcomes=None):
"""GetTestResults.
Get test results for a test run.
:param str project: Project ID or project name
:param int run_id: Test run ID of test results to fetch.
:param str details_to_include: Details to include with test results. Default is None. Other values are Iterations and WorkItems.
:param int skip: Number of test results to skip from beginning.
:param int top: Number of test results to return. Maximum is 1000 when detailsToInclude is None and 200 otherwise.
:param [TestOutcome] outcomes: Comma separated list of test outcomes to filter test results.
:rtype: [TestCaseResult]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
query_parameters = {}
if details_to_include is not None:
query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str')
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
if outcomes is not None:
outcomes = ",".join(map(str, outcomes))
query_parameters['outcomes'] = self._serialize.query('outcomes', outcomes, 'str')
response = self._send(http_method='GET',
location_id='4637d869-3a76-4468-8057-0bb02aa385cf',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestCaseResult]', self._unwrap_collection(response))
def update_test_results(self, results, project, run_id):
"""UpdateTestResults.
Update test results in a test run.
:param [TestCaseResult] results: List of test results to update.
:param str project: Project ID or project name
:param int run_id: Test run ID whose test results to update.
:rtype: [TestCaseResult]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
content = self._serialize.body(results, '[TestCaseResult]')
response = self._send(http_method='PATCH',
location_id='4637d869-3a76-4468-8057-0bb02aa385cf',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('[TestCaseResult]', self._unwrap_collection(response))
def get_test_run_statistics(self, project, run_id):
"""GetTestRunStatistics.
Get test run statistics
:param str project: Project ID or project name
:param int run_id: ID of the run to get.
:rtype: :class:`<TestRunStatistic> <azure.devops.v5_0.test.models.TestRunStatistic>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
response = self._send(http_method='GET',
location_id='0a42c424-d764-4a16-a2d5-5c85f87d0ae8',
version='5.0',
route_values=route_values)
return self._deserialize('TestRunStatistic', response)
def create_test_run(self, test_run, project):
"""CreateTestRun.
Create new test run.
:param :class:`<RunCreateModel> <azure.devops.v5_0.test.models.RunCreateModel>` test_run: Run details RunCreateModel
:param str project: Project ID or project name
:rtype: :class:`<TestRun> <azure.devops.v5_0.test.models.TestRun>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(test_run, 'RunCreateModel')
response = self._send(http_method='POST',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('TestRun', response)
def delete_test_run(self, project, run_id):
"""DeleteTestRun.
Delete a test run by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the run to delete.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
self._send(http_method='DELETE',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values)
def get_test_run_by_id(self, project, run_id, include_details=None):
"""GetTestRunById.
Get a test run by its ID.
:param str project: Project ID or project name
:param int run_id: ID of the run to get.
:param bool include_details: Defualt value is true. It includes details like run statistics,release,build,Test enviornment,Post process state and more
:rtype: :class:`<TestRun> <azure.devops.v5_0.test.models.TestRun>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
query_parameters = {}
if include_details is not None:
query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool')
response = self._send(http_method='GET',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('TestRun', response)
def get_test_runs(self, project, build_uri=None, owner=None, tmi_run_id=None, plan_id=None, include_run_details=None, automated=None, skip=None, top=None):
"""GetTestRuns.
Get a list of test runs.
:param str project: Project ID or project name
:param str build_uri: URI of the build that the runs used.
:param str owner: Team foundation ID of the owner of the runs.
:param str tmi_run_id:
:param int plan_id: ID of the test plan that the runs are a part of.
:param bool include_run_details: If true, include all the properties of the runs.
:param bool automated: If true, only returns automated runs.
:param int skip: Number of test runs to skip.
:param int top: Number of test runs to return.
:rtype: [TestRun]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if build_uri is not None:
query_parameters['buildUri'] = self._serialize.query('build_uri', build_uri, 'str')
if owner is not None:
query_parameters['owner'] = self._serialize.query('owner', owner, 'str')
if tmi_run_id is not None:
query_parameters['tmiRunId'] = self._serialize.query('tmi_run_id', tmi_run_id, 'str')
if plan_id is not None:
query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'int')
if include_run_details is not None:
query_parameters['includeRunDetails'] = self._serialize.query('include_run_details', include_run_details, 'bool')
if automated is not None:
query_parameters['automated'] = self._serialize.query('automated', automated, 'bool')
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
response = self._send(http_method='GET',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestRun]', self._unwrap_collection(response))
def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, state=None, plan_ids=None, is_automated=None, publish_context=None, build_ids=None, build_def_ids=None, branch_name=None, release_ids=None, release_def_ids=None, release_env_ids=None, release_env_def_ids=None, run_title=None, top=None, continuation_token=None):
"""QueryTestRuns.
Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate.
:param str project: Project ID or project name
:param datetime min_last_updated_date: Minimum Last Modified Date of run to be queried (Mandatory).
:param datetime max_last_updated_date: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days).
:param str state: Current state of the Runs to be queried.
:param [int] plan_ids: Plan Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param bool is_automated: Automation type of the Runs to be queried.
:param str publish_context: PublishContext of the Runs to be queried.
:param [int] build_ids: Build Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param str branch_name: Source Branch name of the Runs to be queried.
:param [int] release_ids: Release Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param [int] release_env_def_ids: Release Environment Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10).
:param str run_title: Run Title of the Runs to be queried.
:param int top: Number of runs to be queried. Limit is 100
:param str continuation_token: continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user.
:rtype: [TestRun]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if min_last_updated_date is not None:
query_parameters['minLastUpdatedDate'] = self._serialize.query('min_last_updated_date', min_last_updated_date, 'iso-8601')
if max_last_updated_date is not None:
query_parameters['maxLastUpdatedDate'] = self._serialize.query('max_last_updated_date', max_last_updated_date, 'iso-8601')
if state is not None:
query_parameters['state'] = self._serialize.query('state', state, 'str')
if plan_ids is not None:
plan_ids = ",".join(map(str, plan_ids))
query_parameters['planIds'] = self._serialize.query('plan_ids', plan_ids, 'str')
if is_automated is not None:
query_parameters['isAutomated'] = self._serialize.query('is_automated', is_automated, 'bool')
if publish_context is not None:
query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str')
if build_ids is not None:
build_ids = ",".join(map(str, build_ids))
query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str')
if build_def_ids is not None:
build_def_ids = ",".join(map(str, build_def_ids))
query_parameters['buildDefIds'] = self._serialize.query('build_def_ids', build_def_ids, 'str')
if branch_name is not None:
query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str')
if release_ids is not None:
release_ids = ",".join(map(str, release_ids))
query_parameters['releaseIds'] = self._serialize.query('release_ids', release_ids, 'str')
if release_def_ids is not None:
release_def_ids = ",".join(map(str, release_def_ids))
query_parameters['releaseDefIds'] = self._serialize.query('release_def_ids', release_def_ids, 'str')
if release_env_ids is not None:
release_env_ids = ",".join(map(str, release_env_ids))
query_parameters['releaseEnvIds'] = self._serialize.query('release_env_ids', release_env_ids, 'str')
if release_env_def_ids is not None:
release_env_def_ids = ",".join(map(str, release_env_def_ids))
query_parameters['releaseEnvDefIds'] = self._serialize.query('release_env_def_ids', release_env_def_ids, 'str')
if run_title is not None:
query_parameters['runTitle'] = self._serialize.query('run_title', run_title, 'str')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
if continuation_token is not None:
query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str')
response = self._send(http_method='GET',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestRun]', self._unwrap_collection(response))
def update_test_run(self, run_update_model, project, run_id):
"""UpdateTestRun.
Update test run by its ID.
:param :class:`<RunUpdateModel> <azure.devops.v5_0.test.models.RunUpdateModel>` run_update_model: Run details RunUpdateModel
:param str project: Project ID or project name
:param int run_id: ID of the run to update.
:rtype: :class:`<TestRun> <azure.devops.v5_0.test.models.TestRun>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if run_id is not None:
route_values['runId'] = self._serialize.url('run_id', run_id, 'int')
content = self._serialize.body(run_update_model, 'RunUpdateModel')
response = self._send(http_method='PATCH',
location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('TestRun', response)
def create_test_session(self, test_session, team_context):
"""CreateTestSession.
[Preview API] Create a test session
:param :class:`<TestSession> <azure.devops.v5_0.test.models.TestSession>` test_session: Test session details for creation
:param :class:`<TeamContext> <azure.devops.v5_0.test.models.TeamContext>` team_context: The team context for the operation
:rtype: :class:`<TestSession> <azure.devops.v5_0.test.models.TestSession>`
"""
project = None
team = None
if team_context is not None:
if team_context.project_id:
project = team_context.project_id
else:
project = team_context.project
if team_context.team_id:
team = team_context.team_id
else:
team = team_context.team
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'string')
if team is not None:
route_values['team'] = self._serialize.url('team', team, 'string')
content = self._serialize.body(test_session, 'TestSession')
response = self._send(http_method='POST',
location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestSession', response)
def get_test_sessions(self, team_context, period=None, all_sessions=None, include_all_properties=None, source=None, include_only_completed_sessions=None):
"""GetTestSessions.
[Preview API] Get a list of test sessions
:param :class:`<TeamContext> <azure.devops.v5_0.test.models.TeamContext>` team_context: The team context for the operation
:param int period: Period in days from now, for which test sessions are fetched.
:param bool all_sessions: If false, returns test sessions for current user. Otherwise, it returns test sessions for all users
:param bool include_all_properties: If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version.
:param str source: Source of the test session.
:param bool include_only_completed_sessions: If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states
:rtype: [TestSession]
"""
project = None
team = None
if team_context is not None:
if team_context.project_id:
project = team_context.project_id
else:
project = team_context.project
if team_context.team_id:
team = team_context.team_id
else:
team = team_context.team
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'string')
if team is not None:
route_values['team'] = self._serialize.url('team', team, 'string')
query_parameters = {}
if period is not None:
query_parameters['period'] = self._serialize.query('period', period, 'int')
if all_sessions is not None:
query_parameters['allSessions'] = self._serialize.query('all_sessions', all_sessions, 'bool')
if include_all_properties is not None:
query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool')
if source is not None:
query_parameters['source'] = self._serialize.query('source', source, 'str')
if include_only_completed_sessions is not None:
query_parameters['includeOnlyCompletedSessions'] = self._serialize.query('include_only_completed_sessions', include_only_completed_sessions, 'bool')
response = self._send(http_method='GET',
location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestSession]', self._unwrap_collection(response))
def update_test_session(self, test_session, team_context):
"""UpdateTestSession.
[Preview API] Update a test session
:param :class:`<TestSession> <azure.devops.v5_0.test.models.TestSession>` test_session: Test session details for update
:param :class:`<TeamContext> <azure.devops.v5_0.test.models.TeamContext>` team_context: The team context for the operation
:rtype: :class:`<TestSession> <azure.devops.v5_0.test.models.TestSession>`
"""
project = None
team = None
if team_context is not None:
if team_context.project_id:
project = team_context.project_id
else:
project = team_context.project
if team_context.team_id:
team = team_context.team_id
else:
team = team_context.team
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'string')
if team is not None:
route_values['team'] = self._serialize.url('team', team, 'string')
content = self._serialize.body(test_session, 'TestSession')
response = self._send(http_method='PATCH',
location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestSession', response)
def get_suite_entries(self, project, suite_id):
"""GetSuiteEntries.
[Preview API] Get a list of test suite entries in the test suite.
:param str project: Project ID or project name
:param int suite_id: Id of the parent suite.
:rtype: [SuiteEntry]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
response = self._send(http_method='GET',
location_id='bf8b7f78-0c1f-49cb-89e9-d1a17bcaaad3',
version='5.0-preview.1',
route_values=route_values)
return self._deserialize('[SuiteEntry]', self._unwrap_collection(response))
def reorder_suite_entries(self, suite_entries, project, suite_id):
"""ReorderSuiteEntries.
[Preview API] Reorder test suite entries in the test suite.
:param [SuiteEntryUpdateModel] suite_entries: List of SuiteEntryUpdateModel to reorder.
:param str project: Project ID or project name
:param int suite_id: Id of the parent test suite.
:rtype: [SuiteEntry]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
content = self._serialize.body(suite_entries, '[SuiteEntryUpdateModel]')
response = self._send(http_method='PATCH',
location_id='bf8b7f78-0c1f-49cb-89e9-d1a17bcaaad3',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('[SuiteEntry]', self._unwrap_collection(response))
def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids):
"""AddTestCasesToSuite.
Add test cases to suite.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suite.
:param int suite_id: ID of the test suite to which the test cases must be added.
:param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format.
:rtype: [SuiteTestCase]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if test_case_ids is not None:
route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str')
route_values['action'] = 'TestCases'
response = self._send(http_method='POST',
location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e',
version='5.0',
route_values=route_values)
return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response))
def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids):
"""GetTestCaseById.
Get a specific test case in a test suite with test case id.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suites.
:param int suite_id: ID of the suite that contains the test case.
:param int test_case_ids: ID of the test case to get.
:rtype: :class:`<SuiteTestCase> <azure.devops.v5_0.test.models.SuiteTestCase>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if test_case_ids is not None:
route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'int')
route_values['action'] = 'TestCases'
response = self._send(http_method='GET',
location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e',
version='5.0',
route_values=route_values)
return self._deserialize('SuiteTestCase', response)
def get_test_cases(self, project, plan_id, suite_id):
"""GetTestCases.
Get all test cases in a suite.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suites.
:param int suite_id: ID of the suite to get.
:rtype: [SuiteTestCase]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
route_values['action'] = 'TestCases'
response = self._send(http_method='GET',
location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e',
version='5.0',
route_values=route_values)
return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response))
def remove_test_cases_from_suite_url(self, project, plan_id, suite_id, test_case_ids):
"""RemoveTestCasesFromSuiteUrl.
The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suite.
:param int suite_id: ID of the suite to get.
:param str test_case_ids: IDs of the test cases to remove from the suite.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if test_case_ids is not None:
route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str')
route_values['action'] = 'TestCases'
self._send(http_method='DELETE',
location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e',
version='5.0',
route_values=route_values)
def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id, suite_id, test_case_ids):
"""UpdateSuiteTestCases.
Updates the properties of the test case association in a suite.
:param :class:`<SuiteTestCaseUpdateModel> <azure.devops.v5_0.test.models.SuiteTestCaseUpdateModel>` suite_test_case_update_model: Model for updation of the properties of test case suite association.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suite.
:param int suite_id: ID of the test suite to which the test cases must be added.
:param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format.
:rtype: [SuiteTestCase]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
if test_case_ids is not None:
route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str')
route_values['action'] = 'TestCases'
content = self._serialize.body(suite_test_case_update_model, 'SuiteTestCaseUpdateModel')
response = self._send(http_method='PATCH',
location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response))
def create_test_suite(self, test_suite, project, plan_id, suite_id):
"""CreateTestSuite.
Create a test suite.
:param :class:`<SuiteCreateModel> <azure.devops.v5_0.test.models.SuiteCreateModel>` test_suite: Test suite data.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suite.
:param int suite_id: ID of the parent suite.
:rtype: [TestSuite]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
content = self._serialize.body(test_suite, 'SuiteCreateModel')
response = self._send(http_method='POST',
location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('[TestSuite]', self._unwrap_collection(response))
def delete_test_suite(self, project, plan_id, suite_id):
"""DeleteTestSuite.
Delete test suite.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suite.
:param int suite_id: ID of the test suite to delete.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
self._send(http_method='DELETE',
location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1',
version='5.0',
route_values=route_values)
def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None):
"""GetTestSuiteById.
Get test suite by suite id.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suites.
:param int suite_id: ID of the suite to get.
:param int expand: Include the children suites and testers details
:rtype: :class:`<TestSuite> <azure.devops.v5_0.test.models.TestSuite>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
query_parameters = {}
if expand is not None:
query_parameters['$expand'] = self._serialize.query('expand', expand, 'int')
response = self._send(http_method='GET',
location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('TestSuite', response)
def get_test_suites_for_plan(self, project, plan_id, expand=None, skip=None, top=None, as_tree_view=None):
"""GetTestSuitesForPlan.
Get test suites for plan.
:param str project: Project ID or project name
:param int plan_id: ID of the test plan for which suites are requested.
:param int expand: Include the children suites and testers details.
:param int skip: Number of suites to skip from the result.
:param int top: Number of Suites to be return after skipping the suites from the result.
:param bool as_tree_view: If the suites returned should be in a tree structure.
:rtype: [TestSuite]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
query_parameters = {}
if expand is not None:
query_parameters['$expand'] = self._serialize.query('expand', expand, 'int')
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
if as_tree_view is not None:
query_parameters['$asTreeView'] = self._serialize.query('as_tree_view', as_tree_view, 'bool')
response = self._send(http_method='GET',
location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1',
version='5.0',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestSuite]', self._unwrap_collection(response))
def update_test_suite(self, suite_update_model, project, plan_id, suite_id):
"""UpdateTestSuite.
Update a test suite.
:param :class:`<SuiteUpdateModel> <azure.devops.v5_0.test.models.SuiteUpdateModel>` suite_update_model: Suite Model to update
:param str project: Project ID or project name
:param int plan_id: ID of the test plan that contains the suites.
:param int suite_id: ID of the suite to update.
:rtype: :class:`<TestSuite> <azure.devops.v5_0.test.models.TestSuite>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if plan_id is not None:
route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int')
if suite_id is not None:
route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int')
content = self._serialize.body(suite_update_model, 'SuiteUpdateModel')
response = self._send(http_method='PATCH',
location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1',
version='5.0',
route_values=route_values,
content=content)
return self._deserialize('TestSuite', response)
def get_suites_by_test_case_id(self, test_case_id):
"""GetSuitesByTestCaseId.
Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case.
:param int test_case_id: ID of the test case for which suites need to be fetched.
:rtype: [TestSuite]
"""
query_parameters = {}
if test_case_id is not None:
query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'int')
response = self._send(http_method='GET',
location_id='09a6167b-e969-4775-9247-b94cf3819caf',
version='5.0',
query_parameters=query_parameters)
return self._deserialize('[TestSuite]', self._unwrap_collection(response))
def delete_test_case(self, project, test_case_id):
"""DeleteTestCase.
[Preview API] Delete a test case.
:param str project: Project ID or project name
:param int test_case_id: Id of test case to delete.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_case_id is not None:
route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'int')
self._send(http_method='DELETE',
location_id='4d472e0f-e32c-4ef8-adf4-a4078772889c',
version='5.0-preview.1',
route_values=route_values)
def query_test_history(self, filter, project):
"""QueryTestHistory.
[Preview API] Get history of a test method using TestHistoryQuery
:param :class:`<TestHistoryQuery> <azure.devops.v5_0.test.models.TestHistoryQuery>` filter: TestHistoryQuery to get history
:param str project: Project ID or project name
:rtype: :class:`<TestHistoryQuery> <azure.devops.v5_0.test.models.TestHistoryQuery>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(filter, 'TestHistoryQuery')
response = self._send(http_method='POST',
location_id='929fd86c-3e38-4d8c-b4b6-90df256e5971',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestHistoryQuery', response)
def create_test_variable(self, test_variable, project):
"""CreateTestVariable.
[Preview API] Create a test variable.
:param :class:`<TestVariable> <azure.devops.v5_0.test.models.TestVariable>` test_variable: TestVariable
:param str project: Project ID or project name
:rtype: :class:`<TestVariable> <azure.devops.v5_0.test.models.TestVariable>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
content = self._serialize.body(test_variable, 'TestVariable')
response = self._send(http_method='POST',
location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestVariable', response)
def delete_test_variable(self, project, test_variable_id):
"""DeleteTestVariable.
[Preview API] Delete a test variable by its ID.
:param str project: Project ID or project name
:param int test_variable_id: ID of the test variable to delete.
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_variable_id is not None:
route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int')
self._send(http_method='DELETE',
location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912',
version='5.0-preview.1',
route_values=route_values)
def get_test_variable_by_id(self, project, test_variable_id):
"""GetTestVariableById.
[Preview API] Get a test variable by its ID.
:param str project: Project ID or project name
:param int test_variable_id: ID of the test variable to get.
:rtype: :class:`<TestVariable> <azure.devops.v5_0.test.models.TestVariable>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_variable_id is not None:
route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int')
response = self._send(http_method='GET',
location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912',
version='5.0-preview.1',
route_values=route_values)
return self._deserialize('TestVariable', response)
def get_test_variables(self, project, skip=None, top=None):
"""GetTestVariables.
[Preview API] Get a list of test variables.
:param str project: Project ID or project name
:param int skip: Number of test variables to skip.
:param int top: Number of test variables to return.
:rtype: [TestVariable]
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
query_parameters = {}
if skip is not None:
query_parameters['$skip'] = self._serialize.query('skip', skip, 'int')
if top is not None:
query_parameters['$top'] = self._serialize.query('top', top, 'int')
response = self._send(http_method='GET',
location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912',
version='5.0-preview.1',
route_values=route_values,
query_parameters=query_parameters)
return self._deserialize('[TestVariable]', self._unwrap_collection(response))
def update_test_variable(self, test_variable, project, test_variable_id):
"""UpdateTestVariable.
[Preview API] Update a test variable by its ID.
:param :class:`<TestVariable> <azure.devops.v5_0.test.models.TestVariable>` test_variable: TestVariable
:param str project: Project ID or project name
:param int test_variable_id: ID of the test variable to update.
:rtype: :class:`<TestVariable> <azure.devops.v5_0.test.models.TestVariable>`
"""
route_values = {}
if project is not None:
route_values['project'] = self._serialize.url('project', project, 'str')
if test_variable_id is not None:
route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int')
content = self._serialize.body(test_variable, 'TestVariable')
response = self._send(http_method='PATCH',
location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912',
version='5.0-preview.1',
route_values=route_values,
content=content)
return self._deserialize('TestVariable', response)
|