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

testit-tms / adapters-python / 21511770700

30 Jan 2026 09:56AM UTC coverage: 37.233% (+16.4%) from 20.816%
21511770700

Pull #226

github

web-flow
Merge d20a365b2 into 786f4dcb1
Pull Request #226: release: support tms 5.6.

21 of 45 new or added lines in 7 files covered. (46.67%)

1327 of 3564 relevant lines covered (37.23%)

0.74 hits per line

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

44.0
/testit-python-commons/src/testit_python_commons/client/helpers/threads_manager.py
1
from testit_api_client.models import (
2✔
2
    AutoTestCreateApiModel,
3
    AutoTestUpdateApiModel,
4
    AutoTestResultsForTestRunModel,
5
)
6

7
from testit_python_commons.client.models import (
2✔
8
    ThreadForCreateAndResult,
9
    ThreadsForCreateAndResult,
10
    ThreadForUpdateAndResult,
11
    ThreadsForUpdateAndResult
12
)
13
from testit_python_commons.services.logger import adapter_logger
2✔
14
from typing import Dict, List
2✔
15

16

17
class ThreadsManager:
2✔
18
    def __init__(self):
2✔
NEW
19
        self.__thread_for_create: Dict[str, AutoTestCreateApiModel] = {}
×
NEW
20
        self.__thread_for_update: Dict[str, AutoTestUpdateApiModel] = {}
×
21
        self.__threads_results_for_created_autotests: List[Dict[str, AutoTestResultsForTestRunModel]] = []
×
22
        self.__threads_results_for_updated_autotests: List[Dict[str, AutoTestResultsForTestRunModel]] = []
×
23
        self.__thread_for_autotest_links_to_wi_for_update: Dict[str, List[str]] = {}
×
24

25
    @adapter_logger
2✔
26
    def get_thread_for_create_and_result(self, external_id: str) -> ThreadForCreateAndResult:
2✔
27
        thread_results_for_created_autotests = self.__get_thread_results_for_created_autotests(external_id)
×
28

29
        return ThreadForCreateAndResult(self.__thread_for_create, thread_results_for_created_autotests)
×
30

31
    @adapter_logger
2✔
32
    def get_all_threads_for_create_and_result(self) -> ThreadsForCreateAndResult:
2✔
33
        return ThreadsForCreateAndResult(self.__thread_for_create, self.__threads_results_for_created_autotests)
×
34

35
    @adapter_logger
2✔
36
    def get_thread_for_update_and_result(self, external_id: str) -> ThreadForUpdateAndResult:
2✔
37
        thread_results_for_updated_autotests = self.__get_thread_results_for_updated_autotests(external_id)
×
38

39
        return ThreadForUpdateAndResult(
×
40
            self.__thread_for_update,
41
            thread_results_for_updated_autotests,
42
            self.__thread_for_autotest_links_to_wi_for_update
43
        )
44

45
    @adapter_logger
2✔
46
    def get_all_threads_for_update_and_result(self) -> ThreadsForUpdateAndResult:
2✔
47
        return ThreadsForUpdateAndResult(
×
48
            self.__thread_for_update,
49
            self.__threads_results_for_updated_autotests,
50
            self.__thread_for_autotest_links_to_wi_for_update
51
        )
52

53
    @adapter_logger
2✔
54
    def delete_threads_for_create_and_result(self):
2✔
55
        self.__thread_for_create.clear()
×
56
        self.__threads_results_for_created_autotests.clear()
×
57

58
    @adapter_logger
2✔
59
    def delete_threads_for_update_and_result(self):
2✔
60
        self.__thread_for_update.clear()
×
61
        self.__threads_results_for_updated_autotests.clear()
×
62
        self.__thread_for_autotest_links_to_wi_for_update.clear()
×
63

64
    @adapter_logger
2✔
65
    def __get_thread_results_for_created_autotests(self, external_id: str) -> Dict[str, AutoTestResultsForTestRunModel]:
2✔
66
        for thread in self.__threads_results_for_created_autotests:
×
67
            if external_id not in thread.keys():
×
68
                return thread
×
69

70
        new_thread: Dict[str, AutoTestResultsForTestRunModel] = {}
×
71

72
        self.__threads_results_for_created_autotests.append(new_thread)
×
73

74
        return new_thread
×
75

76
    @adapter_logger
2✔
77
    def __get_thread_results_for_updated_autotests(self, external_id: str) -> Dict[str, AutoTestResultsForTestRunModel]:
2✔
78
        for thread in self.__threads_results_for_updated_autotests:
×
79
            if external_id not in thread.keys():
×
80
                return thread
×
81

82
        new_thread: Dict[str, AutoTestResultsForTestRunModel] = {}
×
83

84
        self.__threads_results_for_updated_autotests.append(new_thread)
×
85

86
        return new_thread
×
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