• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

testit-tms / adapters-python / 18900873859

29 Oct 2025 07:54AM UTC coverage: 36.921% (+0.03%) from 36.89%
18900873859

Pull #211

github

web-flow
Merge 26623bc01 into b45a2cdad
Pull Request #211: feat: TMS-35016: support for updating the test run name for all adapt…

32 of 68 new or added lines in 4 files covered. (47.06%)

75 existing lines in 1 file now uncovered.

1307 of 3540 relevant lines covered (36.92%)

0.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

52.97
/testit-python-commons/src/testit_python_commons/client/converter.py
1
import logging
2✔
2
from typing import List
2✔
3

4
from testit_api_client.models import (
2✔
5
    ApiV2TestResultsSearchPostRequest,
6
    AutoTestApiResult,
7
    AttachmentPutModelAutoTestStepResultsModel,
8
    AutoTestStepResultUpdateRequest,
9
    CreateAutoTestRequest,
10
    UpdateAutoTestRequest,
11
    AutoTestPostModel,
12
    AutoTestPutModel,
13
    AutoTestResultsForTestRunModel,
14
    AutoTestStepModel,
15
    AvailableTestResultOutcome,
16
    LinkPostModel,
17
    LinkPutModel,
18
    LinkType,
19
    CreateEmptyRequest,
20
    TestRunV2ApiResult,
21
    TestResultShortResponse,
22
    AutoTestSearchApiModelFilter,
23
    AutoTestSearchApiModelIncludes,
24
    ApiV2AutoTestsSearchPostRequest,
25
    ApiV2TestResultsIdPutRequest,
26
    TestResultResponse,
27
    AttachmentApiResult,
28
    AttachmentUpdateRequest,
29
    UpdateEmptyRequest,
30
    LinkApiResult,
31
    UpdateLinkApiModel,
32
    AssignAttachmentApiModel,
33
)
34

35
from testit_python_commons.models.link import Link
2✔
36
from testit_python_commons.models.step_result import StepResult
2✔
37
from testit_python_commons.models.test_result import TestResult
2✔
38
from testit_python_commons.models.test_result_with_all_fixture_step_results_model import TestResultWithAllFixtureStepResults
2✔
39
from testit_python_commons.services.logger import adapter_logger
2✔
40

41

42
class Converter:
2✔
43
    @staticmethod
2✔
44
    @adapter_logger
2✔
45
    def test_run_to_test_run_short_model(project_id: str, name: str) -> CreateEmptyRequest:
2✔
46
        return CreateEmptyRequest(
×
47
            project_id=project_id,
48
            name=name
49
        )
50

51
    @staticmethod
2✔
52
    @adapter_logger
2✔
53
    def get_id_from_create_test_run_response(response: TestRunV2ApiResult) -> str:
2✔
54
        return response.id
×
55

56
    @classmethod
2✔
57
    @adapter_logger
2✔
58
    def build_update_empty_request(cls, test_run: TestRunV2ApiResult) -> UpdateEmptyRequest:
2✔
NEW
59
        return UpdateEmptyRequest(
×
60
            id=test_run.id,
61
            name=test_run.name,
62
            description=test_run.description,
63
            launch_source=test_run.launch_source,
64
            attachments=cls.build_assign_attachment_api_models(test_run.attachments),
65
            links=cls.build_update_link_api_models(test_run.links)
66
        )
67

68
    @classmethod
2✔
69
    @adapter_logger
2✔
70
    def build_update_link_api_models(cls, links: List[LinkApiResult]) -> List[UpdateLinkApiModel]:
2✔
NEW
71
        update_links = []
×
72

NEW
73
        for link in links:
×
NEW
74
            update_links.append(cls.build_update_link_api_model(link))
×
75

NEW
76
        return update_links
×
77

78
    @staticmethod
2✔
79
    @adapter_logger
2✔
80
    def build_update_link_api_model(link: LinkApiResult) -> UpdateLinkApiModel:
2✔
NEW
81
        return UpdateLinkApiModel(
×
82
            id=link.id,
83
            title=link.title,
84
            description=link.description,
85
            type=link.type,
86
            url=link.url,
87
            has_info=link.has_info
88
        )
89

90
    @classmethod
2✔
91
    @adapter_logger
2✔
92
    def build_assign_attachment_api_models(
2✔
93
            cls,
94
            attachments: List[AttachmentApiResult]
95
    ) -> List[AssignAttachmentApiModel]:
NEW
UNCOV
96
        update_attachments = []
×
97

NEW
UNCOV
98
        for attachment in attachments:
×
NEW
UNCOV
99
            update_attachments.append(cls.build_assign_attachment_api_model(attachment))
×
100

NEW
UNCOV
101
        return update_attachments
×
102

103
    @staticmethod
2✔
104
    @adapter_logger
2✔
105
    def build_assign_attachment_api_model(attachment: AttachmentApiResult) -> AssignAttachmentApiModel:
2✔
NEW
UNCOV
106
        return AssignAttachmentApiModel(id=attachment.id)
×
107

108
    @staticmethod
2✔
109
    @adapter_logger
2✔
110
    def project_id_and_external_id_to_auto_tests_search_post_request(
2✔
111
            project_id: str,
112
            external_id: str
113
    ) -> ApiV2AutoTestsSearchPostRequest:
UNCOV
114
        autotests_filter = AutoTestSearchApiModelFilter(
×
115
            project_ids=[project_id],
116
            external_ids=[external_id],
117
            is_deleted=False)
118
        autotests_includes = AutoTestSearchApiModelIncludes(
×
119
            include_steps=False,
120
            include_links=False,
121
            include_labels=False)
122

123
        return ApiV2AutoTestsSearchPostRequest(filter=autotests_filter, includes=autotests_includes)
×
124

125
    @staticmethod
2✔
126
    @adapter_logger
2✔
127
    def build_test_results_search_post_request_with_in_progress_outcome(
2✔
128
            testrun_id: str,
129
            configuration_id: str) -> ApiV2TestResultsSearchPostRequest:
130
        return ApiV2TestResultsSearchPostRequest(
×
131
            test_run_ids=[testrun_id],
132
            configuration_ids=[configuration_id],
133
            status_codes=["InProgress"])
134

135
    @staticmethod
2✔
136
    @adapter_logger
2✔
137
    def autotest_ids_to_autotests_search_post_request(
2✔
138
            autotest_ids: List[int]) -> ApiV2AutoTestsSearchPostRequest:
UNCOV
139
        autotests_filter = AutoTestSearchApiModelFilter(
×
140
            global_ids=autotest_ids)
UNCOV
141
        autotests_includes = AutoTestSearchApiModelIncludes(
×
142
            include_steps=False,
143
            include_links=False,
144
            include_labels=False)
145

UNCOV
146
        return ApiV2AutoTestsSearchPostRequest(filter=autotests_filter, includes=autotests_includes)
×
147

148
    @staticmethod
2✔
149
    @adapter_logger
2✔
150
    def get_external_ids_from_autotest_response_list(
2✔
151
            autotests: List[TestResultShortResponse],
152
            configuration: str) -> List[str]:
UNCOV
153
        external_ids: List[str] = []
×
154

UNCOV
155
        for autotest in autotests:
×
UNCOV
156
            if configuration == autotest.configuration_id:
×
UNCOV
157
                external_ids.append(autotest.autotest_external_id)
×
158

UNCOV
159
        return external_ids
×
160

161
    @classmethod
2✔
162
    @adapter_logger
2✔
163
    def test_result_to_autotest_post_model(
2✔
164
            cls,
165
            test_result: TestResult,
166
            project_id: str) -> AutoTestPostModel:
UNCOV
167
        return AutoTestPostModel(
×
168
            external_id=test_result.get_external_id(),
169
            project_id=project_id,
170
            name=test_result.get_autotest_name(),
171
            steps=cls.step_results_to_autotest_steps_model(
172
                test_result.get_step_results()),
173
            setup=cls.step_results_to_autotest_steps_model(
174
                test_result.get_setup_results()),
175
            teardown=cls.step_results_to_autotest_steps_model(
176
                test_result.get_teardown_results()),
177
            namespace=test_result.get_namespace(),
178
            classname=test_result.get_classname(),
179
            title=test_result.get_title(),
180
            description=test_result.get_description(),
181
            links=cls.links_to_links_post_model(test_result.get_links()),
182
            labels=test_result.get_labels(),
183
            should_create_work_item=test_result.get_automatic_creation_test_cases(),
184
            external_key=test_result.get_external_key()
185
        )
186

187
    @classmethod
2✔
188
    @adapter_logger
2✔
189
    def test_result_to_create_autotest_request(
2✔
190
            cls,
191
            test_result: TestResult,
192
            project_id: str) -> CreateAutoTestRequest:
UNCOV
193
        return CreateAutoTestRequest(
×
194
            external_id=test_result.get_external_id(),
195
            project_id=project_id,
196
            name=test_result.get_autotest_name(),
197
            steps=cls.step_results_to_autotest_steps_model(
198
                test_result.get_step_results()),
199
            setup=cls.step_results_to_autotest_steps_model(
200
                test_result.get_setup_results()),
201
            teardown=cls.step_results_to_autotest_steps_model(
202
                test_result.get_teardown_results()),
203
            namespace=test_result.get_namespace(),
204
            classname=test_result.get_classname(),
205
            title=test_result.get_title(),
206
            description=test_result.get_description(),
207
            links=cls.links_to_links_post_model(test_result.get_links()),
208
            labels=test_result.get_labels(),
209
            should_create_work_item=test_result.get_automatic_creation_test_cases(),
210
            external_key=test_result.get_external_key()
211
        )
212

213
    @classmethod
2✔
214
    @adapter_logger
2✔
215
    def test_result_to_autotest_put_model(
2✔
216
            cls,
217
            test_result: TestResult,
218
            project_id: str) -> AutoTestPutModel:
UNCOV
219
        if test_result.get_outcome() == 'Passed':
×
UNCOV
220
            return AutoTestPutModel(
×
221
                external_id=test_result.get_external_id(),
222
                project_id=project_id,
223
                name=test_result.get_autotest_name(),
224
                steps=cls.step_results_to_autotest_steps_model(
225
                    test_result.get_step_results()),
226
                setup=cls.step_results_to_autotest_steps_model(
227
                    test_result.get_setup_results()),
228
                teardown=cls.step_results_to_autotest_steps_model(
229
                    test_result.get_teardown_results()),
230
                namespace=test_result.get_namespace(),
231
                classname=test_result.get_classname(),
232
                title=test_result.get_title(),
233
                description=test_result.get_description(),
234
                links=cls.links_to_links_put_model(test_result.get_links()),
235
                labels=test_result.get_labels(),
236
                external_key=test_result.get_external_key()
237
            )
238
        else:
UNCOV
239
            return AutoTestPutModel(
×
240
                external_id=test_result.get_external_id(),
241
                project_id=project_id,
242
                name=test_result.get_autotest_name(),
243
                steps=cls.step_results_to_autotest_steps_model(
244
                    test_result.get_step_results()),
245
                setup=cls.step_results_to_autotest_steps_model(
246
                    test_result.get_setup_results()),
247
                teardown=cls.step_results_to_autotest_steps_model(
248
                    test_result.get_teardown_results()),
249
                namespace=test_result.get_namespace(),
250
                classname=test_result.get_classname(),
251
                title=test_result.get_title(),
252
                description=test_result.get_description(),
253
                links=cls.links_to_links_put_model(test_result.get_links()),
254
                labels=test_result.get_labels(),
255
                external_key=test_result.get_external_key()
256
            )
257

258
    @classmethod
2✔
259
    @adapter_logger
2✔
260
    def test_result_to_update_autotest_request(
2✔
261
            cls,
262
            test_result: TestResult,
263
            project_id: str) -> UpdateAutoTestRequest:
UNCOV
264
        if test_result.get_outcome() == 'Passed':
×
UNCOV
265
            return UpdateAutoTestRequest(
×
266
                external_id=test_result.get_external_id(),
267
                project_id=project_id,
268
                name=test_result.get_autotest_name(),
269
                steps=cls.step_results_to_autotest_steps_model(
270
                    test_result.get_step_results()),
271
                setup=cls.step_results_to_autotest_steps_model(
272
                    test_result.get_setup_results()),
273
                teardown=cls.step_results_to_autotest_steps_model(
274
                    test_result.get_teardown_results()),
275
                namespace=test_result.get_namespace(),
276
                classname=test_result.get_classname(),
277
                title=test_result.get_title(),
278
                description=test_result.get_description(),
279
                links=cls.links_to_links_put_model(test_result.get_links()),
280
                labels=test_result.get_labels(),
281
                external_key=test_result.get_external_key()
282
            )
283
        else:
UNCOV
284
            return UpdateAutoTestRequest(
×
285
                external_id=test_result.get_external_id(),
286
                project_id=project_id,
287
                name=test_result.get_autotest_name(),
288
                steps=cls.step_results_to_autotest_steps_model(
289
                    test_result.get_step_results()),
290
                setup=cls.step_results_to_autotest_steps_model(
291
                    test_result.get_setup_results()),
292
                teardown=cls.step_results_to_autotest_steps_model(
293
                    test_result.get_teardown_results()),
294
                namespace=test_result.get_namespace(),
295
                classname=test_result.get_classname(),
296
                title=test_result.get_title(),
297
                description=test_result.get_description(),
298
                links=cls.links_to_links_put_model(test_result.get_links()),
299
                labels=test_result.get_labels(),
300
                external_key=test_result.get_external_key()
301
            )
302

303
    @classmethod
2✔
304
    @adapter_logger
2✔
305
    def test_result_to_testrun_result_post_model(
2✔
306
            cls,
307
            test_result: TestResult,
308
            configuration_id: str) -> AutoTestResultsForTestRunModel:
UNCOV
309
        return AutoTestResultsForTestRunModel(
×
310
            configuration_id=configuration_id,
311
            auto_test_external_id=test_result.get_external_id(),
312
            status_code=test_result.get_outcome(),
313
            step_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
314
                test_result.get_step_results()),
315
            setup_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
316
                test_result.get_setup_results()),
317
            teardown_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
318
                test_result.get_teardown_results()),
319
            traces=test_result.get_traces(),
320
            attachments=test_result.get_attachments(),
321
            parameters=test_result.get_parameters(),
322
            properties=test_result.get_properties(),
323
            links=cls.links_to_links_post_model(
324
                test_result.get_result_links()),
325
            duration=round(test_result.get_duration()),
326
            message=test_result.get_message(),
327
            started_on=test_result.get_started_on(),
328
            completed_on=test_result.get_completed_on()
329
        )
330

331
    @classmethod
2✔
332
    @adapter_logger
2✔
333
    def convert_test_result_model_to_test_results_id_put_request(
2✔
334
            cls,
335
            test_result: TestResultResponse) -> ApiV2TestResultsIdPutRequest:
UNCOV
336
        return ApiV2TestResultsIdPutRequest(
×
337
            failure_class_ids=test_result.failure_class_ids,
338
            status_code=test_result.status.code,
339
            comment=test_result.comment,
340
            links=test_result.links,
341
            step_results=test_result.step_results,
342
            attachments=cls.attachment_models_to_attachment_put_models(test_result.attachments),
343
            duration_in_ms=test_result.duration_in_ms,
344
            step_comments=test_result.step_comments,
345
            # setup_results=test_result.setup_results,
346
            # teardown_results=test_result.teardown_results,
347
            message=test_result.message,
348
            trace=test_result.traces)
349

350
    @classmethod
2✔
351
    @adapter_logger
2✔
352
    def convert_test_result_with_all_setup_and_teardown_steps_to_test_results_id_put_request(
2✔
353
            cls,
354
            test_result: TestResultWithAllFixtureStepResults) -> ApiV2TestResultsIdPutRequest:
355
        return ApiV2TestResultsIdPutRequest(
×
356
            setup_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
357
                test_result.get_setup_results()),
358
            teardown_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
359
                test_result.get_teardown_results()))
360

361
    @classmethod
2✔
362
    @adapter_logger
2✔
363
    def get_test_result_id_from_testrun_result_post_response(cls, response) -> str:
2✔
UNCOV
364
        return response[0]
×
365

366
    @staticmethod
2✔
367
    @adapter_logger
2✔
368
    def link_to_link_post_model(link: Link) -> LinkPostModel:
2✔
UNCOV
369
        if link.get_link_type():
×
UNCOV
370
            return LinkPostModel(
×
371
                url=link.get_url(),
372
                title=link.get_title(),
373
                type=LinkType(link.get_link_type()),
374
                description=link.get_description(),
375
                has_info=True,
376
            )
377
        else:
UNCOV
378
            return LinkPostModel(
×
379
                url=link.get_url(),
380
                title=link.get_title(),
381
                description=link.get_description(),
382
                has_info=True,
383
            )
384

385
    @staticmethod
2✔
386
    @adapter_logger
2✔
387
    def link_to_link_put_model(link: Link) -> LinkPutModel:
2✔
UNCOV
388
        if link.get_link_type():
×
UNCOV
389
            return LinkPutModel(
×
390
                url=link.get_url(),
391
                title=link.get_title(),
392
                type=LinkType(link.get_link_type()),
393
                description=link.get_description(),
394
                has_info=True,
395
            )
396
        else:
UNCOV
397
            return LinkPutModel(
×
398
                url=link.get_url(),
399
                title=link.get_title(),
400
                description=link.get_description(),
401
                has_info=True,
402
            )
403

404
    @classmethod
2✔
405
    @adapter_logger
2✔
406
    def links_to_links_post_model(cls, links: List[Link]) -> List[LinkPostModel]:
2✔
UNCOV
407
        post_model_links = []
×
408

409
        for link in links:
×
UNCOV
410
            post_model_links.append(
×
411
                cls.link_to_link_post_model(link)
412
            )
413

UNCOV
414
        return post_model_links
×
415

416
    @classmethod
2✔
417
    @adapter_logger
2✔
418
    def links_to_links_put_model(cls, links: List[Link]) -> List[LinkPutModel]:
2✔
UNCOV
419
        put_model_links = []
×
420

421
        for link in links:
×
UNCOV
422
            put_model_links.append(
×
423
                cls.link_to_link_put_model(link)
424
            )
425

UNCOV
426
        return put_model_links
×
427

428
    @classmethod
2✔
429
    @adapter_logger
2✔
430
    def attachment_models_to_attachment_put_models(
2✔
431
            cls, attachments: List[AttachmentApiResult]) -> List[AttachmentUpdateRequest]:
UNCOV
432
        put_model_attachments = []
×
433

UNCOV
434
        for attachment in attachments:
×
UNCOV
435
            put_model_attachments.append(
×
436
                cls.attachment_model_to_attachment_put_model(attachment)
437
            )
438

UNCOV
439
        return put_model_attachments
×
440

441
    @staticmethod
2✔
442
    @adapter_logger
2✔
443
    def attachment_model_to_attachment_put_model(attachment: AttachmentApiResult) -> AttachmentUpdateRequest:
2✔
444
        return AttachmentUpdateRequest(id=attachment.id)
×
445

446
    @classmethod
2✔
447
    # @adapter_logger
448
    def step_results_to_autotest_steps_model(
2✔
449
            cls, step_results: List[StepResult]) -> List[AutoTestStepModel]:
UNCOV
450
        autotest_model_steps = []
×
451

UNCOV
452
        for step_result in step_results:
×
UNCOV
453
            autotest_model_steps.append(
×
454
                AutoTestStepModel(
455
                    title=step_result.get_title(),
456
                    description=step_result.get_description(),
457
                    steps=cls.step_results_to_autotest_steps_model(
458
                        step_result.get_step_results()))
459
            )
460

UNCOV
461
        return autotest_model_steps
×
462

463
    @classmethod
2✔
464
    @adapter_logger
2✔
465
    def step_results_to_attachment_put_model_autotest_step_results_model(
2✔
466
            cls, step_results: List[StepResult]) -> List[AttachmentPutModelAutoTestStepResultsModel]:
UNCOV
467
        autotest_model_step_results = []
×
468

469
        for step_result in step_results:
×
UNCOV
470
            autotest_model_step_results.append(
×
471
                AttachmentPutModelAutoTestStepResultsModel(
472
                    title=step_result.get_title(),
473
                    outcome=AvailableTestResultOutcome(step_result.get_outcome()),
474
                    description=step_result.get_description(),
475
                    duration=step_result.get_duration(),
476
                    parameters=step_result.get_parameters(),
477
                    attachments=step_result.get_attachments(),
478
                    started_on=step_result.get_started_on(),
479
                    completed_on=step_result.get_completed_on(),
480
                    step_results=cls.step_results_to_attachment_put_model_autotest_step_results_model(
481
                        step_result.get_step_results())
482
                )
483
            )
484

485
        return autotest_model_step_results
×
486

487
    @staticmethod
2✔
488
    @adapter_logger
2✔
489
    def fixtures_containers_to_test_results_with_all_fixture_step_results(
2✔
490
            fixtures_containers: dict,
491
            test_result_ids: dict) -> List[TestResultWithAllFixtureStepResults]:
UNCOV
492
        test_results_with_all_fixture_step_results = []
×
493

494
        for external_id, test_result_id in test_result_ids.items():
×
UNCOV
495
            test_result_with_all_fixture_step_results = TestResultWithAllFixtureStepResults(test_result_id)
×
496

UNCOV
497
            for uuid, fixtures_container in fixtures_containers.items():
×
UNCOV
498
                if external_id in fixtures_container.external_ids:
×
UNCOV
499
                    if fixtures_container.befores:
×
UNCOV
500
                        test_result_with_all_fixture_step_results.set_setup_results(fixtures_container.befores[0].steps)
×
501

UNCOV
502
                    if fixtures_container.afters:
×
UNCOV
503
                        test_result_with_all_fixture_step_results.set_teardown_results(
×
504
                            fixtures_container.afters[0].steps)
505

UNCOV
506
            test_results_with_all_fixture_step_results.append(test_result_with_all_fixture_step_results)
×
507

UNCOV
508
        return test_results_with_all_fixture_step_results
×
509

510
    @classmethod
2✔
511
    @adapter_logger
2✔
512
    def step_results_to_auto_test_step_result_update_request(
2✔
513
            cls, step_results: List[StepResult]) -> List[AutoTestStepResultUpdateRequest]:
UNCOV
514
        autotest_model_step_results = []
×
515

UNCOV
516
        for step_result in step_results:
×
UNCOV
517
            autotest_model_step_results.append(
×
518
                AutoTestStepResultUpdateRequest(
519
                    title=step_result.get_title(),
520
                    outcome=AvailableTestResultOutcome(step_result.get_outcome()),
521
                    description=step_result.get_description(),
522
                    duration=step_result.get_duration(),
523
                    parameters=step_result.get_parameters(),
524
                    attachments=step_result.get_attachments(),
525
                    started_on=step_result.get_started_on(),
526
                    completed_on=step_result.get_completed_on(),
527
                    step_results=cls.step_results_to_auto_test_step_result_update_request(
528
                        step_result.get_step_results())
529
                )
530
            )
531

UNCOV
532
        return autotest_model_step_results
×
533

534
    @classmethod
2✔
535
    @adapter_logger
2✔
536
    def prepare_to_create_autotest(
2✔
537
            cls,
538
            test_result: TestResult,
539
            project_id: str,
540
            work_item_ids_for_link_with_auto_test: list) -> CreateAutoTestRequest:
541
        logging.debug('Preparing to create the auto test ' + test_result.get_external_id())
×
542

UNCOV
543
        model = cls.test_result_to_create_autotest_request(
×
544
            test_result,
545
            project_id)
UNCOV
546
        model.work_item_ids_for_link_with_auto_test = work_item_ids_for_link_with_auto_test
×
547

UNCOV
548
        return model
×
549

550
    @classmethod
2✔
551
    @adapter_logger
2✔
552
    def prepare_to_mass_create_autotest(
2✔
553
            cls,
554
            test_result: TestResult,
555
            project_id: str,
556
            work_item_ids_for_link_with_auto_test: list) -> AutoTestPostModel:
UNCOV
557
        logging.debug('Preparing to create the auto test ' + test_result.get_external_id())
×
558

UNCOV
559
        model = cls.test_result_to_autotest_post_model(
×
560
            test_result,
561
            project_id)
UNCOV
562
        model.work_item_ids_for_link_with_auto_test = work_item_ids_for_link_with_auto_test
×
563

UNCOV
564
        return model
×
565

566
    @classmethod
2✔
567
    @adapter_logger
2✔
568
    def prepare_to_update_autotest(
2✔
569
            cls,
570
            test_result: TestResult,
571
            autotest: AutoTestApiResult,
572
            project_id: str) -> UpdateAutoTestRequest:
UNCOV
573
        logging.debug('Preparing to update the auto test ' + test_result.get_external_id())
×
574

575
        model = cls.test_result_to_update_autotest_request(
×
576
            test_result,
577
            project_id)
UNCOV
578
        model.is_flaky = autotest.is_flaky
×
579
        # TODO: return after fix PUT/api/v2/autoTests
580
        # model.work_item_ids_for_link_with_auto_test = self.__get_work_item_uuids_for_link_with_auto_test(
581
        #     test_result.get_work_item_ids(),
582
        #     str(autotest.global_id))
583

UNCOV
584
        return model
×
585

586
    @classmethod
2✔
587
    @adapter_logger
2✔
588
    def prepare_to_mass_update_autotest(
2✔
589
            cls,
590
            test_result: TestResult,
591
            autotest: AutoTestApiResult,
592
            project_id: str) -> AutoTestPutModel:
UNCOV
593
        logging.debug('Preparing to update the auto test ' + test_result.get_external_id())
×
594

UNCOV
595
        model = cls.test_result_to_autotest_put_model(
×
596
            test_result,
597
            project_id)
UNCOV
598
        model.is_flaky = autotest.is_flaky
×
599
        # TODO: return after fix PUT/api/v2/autoTests
600
        # model.work_item_ids_for_link_with_auto_test = self.__get_work_item_uuids_for_link_with_auto_test(
601
        #     test_result.get_work_item_ids(),
602
        #     str(autotest.global_id))
603

UNCOV
604
        return model
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc