otrs-somconnexio 0.5.11__py2.py3-none-any.whl → 0.5.12__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py +16 -0
- otrs_somconnexio/otrs_models/ticket_types/check_coverage_ticket.py +52 -0
- {otrs_somconnexio-0.5.11.dist-info → otrs_somconnexio-0.5.12.dist-info}/METADATA +1 -1
- {otrs_somconnexio-0.5.11.dist-info → otrs_somconnexio-0.5.12.dist-info}/RECORD +7 -4
- tests/otrs_models/ticket_types/test_check_coverage.py +105 -0
- {otrs_somconnexio-0.5.11.dist-info → otrs_somconnexio-0.5.12.dist-info}/WHEEL +0 -0
- {otrs_somconnexio-0.5.11.dist-info → otrs_somconnexio-0.5.12.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
class CheckCoverageConfiguration:
|
|
2
|
+
process_id = "Process-be8cf222949132c9fae1bb74615a5ae4"
|
|
3
|
+
activity_id = "Activity-df0c0c05df090639bb592a6d2af2d893"
|
|
4
|
+
type = "Petición"
|
|
5
|
+
state = "new"
|
|
6
|
+
priority = "3 normal"
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class CheckCoverageCATConfiguration(CheckCoverageConfiguration):
|
|
10
|
+
subject = "Consulta de cobertura (cat)"
|
|
11
|
+
queue_id = 42
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class CheckCoverageESConfiguration(CheckCoverageConfiguration):
|
|
15
|
+
subject = "Consulta de cobertura (es)"
|
|
16
|
+
queue_id = 43
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.querys.check_coverage import (
|
|
2
|
+
CheckCoverageCATConfiguration,
|
|
3
|
+
CheckCoverageESConfiguration,
|
|
4
|
+
)
|
|
5
|
+
from otrs_somconnexio.otrs_models.ticket_types.base_customer_ticket import (
|
|
6
|
+
BaseCustomerTicket,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class CheckCoverageTicket(BaseCustomerTicket):
|
|
11
|
+
def __init__(self, username, customer_code, fields_dict, *args):
|
|
12
|
+
super(CheckCoverageTicket, self).__init__(
|
|
13
|
+
username, customer_code, fields_dict, *args
|
|
14
|
+
)
|
|
15
|
+
self.configuration = (
|
|
16
|
+
CheckCoverageCATConfiguration
|
|
17
|
+
if fields_dict["language"] == "ca_ES"
|
|
18
|
+
else CheckCoverageESConfiguration
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
def _get_activity_id(self):
|
|
22
|
+
return self.configuration.activity_id
|
|
23
|
+
|
|
24
|
+
def _get_process_id(self):
|
|
25
|
+
return self.configuration.process_id
|
|
26
|
+
|
|
27
|
+
def _get_queue_id(self):
|
|
28
|
+
return self.configuration.queue_id
|
|
29
|
+
|
|
30
|
+
def _get_subject(self):
|
|
31
|
+
return self.configuration.subject
|
|
32
|
+
|
|
33
|
+
def _get_dynamic_fields(self):
|
|
34
|
+
return {
|
|
35
|
+
"nomSoci": self.fields["name"],
|
|
36
|
+
"cognom1": self.fields["surnames"],
|
|
37
|
+
"correuElectronic": self.fields["email"],
|
|
38
|
+
"telefonContacte": self.fields["phone"],
|
|
39
|
+
"idioma": self.fields["contact_lang"],
|
|
40
|
+
"tipusVia": self.fields["road_type"],
|
|
41
|
+
"nomVia": self.fields["road_name"],
|
|
42
|
+
"numero": self.fields["road_number"],
|
|
43
|
+
"bloc": self.fields["block"],
|
|
44
|
+
"portal": self.fields["doorway"],
|
|
45
|
+
"pis": self.fields["floor"],
|
|
46
|
+
"escala": self.fields["scale"],
|
|
47
|
+
"porta": self.fields["door"],
|
|
48
|
+
"altresCobertura": self.fields["other_information"],
|
|
49
|
+
"poblacioServei": self.fields["locality"],
|
|
50
|
+
"provinciaServei": self.fields["state"],
|
|
51
|
+
"CPservei": self.fields["zip_code"],
|
|
52
|
+
}
|
|
@@ -45,6 +45,7 @@ otrs_somconnexio/otrs_models/configurations/provision/fiber_ticket.py,sha256=NsF
|
|
|
45
45
|
otrs_somconnexio/otrs_models/configurations/provision/mobile_ticket.py,sha256=TQgQL9ROecEtTMITSGClKeZuCUfofxejdqTgN9MLsHU,1512
|
|
46
46
|
otrs_somconnexio/otrs_models/configurations/provision/router_4G_ticket.py,sha256=hkDaHFAAMFI8gnCZBVns9GLgEb_Cz3BlkoStPt3UZjw,259
|
|
47
47
|
otrs_somconnexio/otrs_models/configurations/querys/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
48
|
+
otrs_somconnexio/otrs_models/configurations/querys/check_coverage.py,sha256=KD-T-NFSbMNW-MM4xXlonJWZz1ZM17brAb9N2-GNswg,479
|
|
48
49
|
otrs_somconnexio/otrs_models/configurations/querys/we_call_you.py,sha256=suuTDHY7cK3iiTX9Bjql2wpCXBpALhLf0lXJ7r0bWZA,423
|
|
49
50
|
otrs_somconnexio/otrs_models/coverage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
51
|
otrs_somconnexio/otrs_models/coverage/adsl.py,sha256=ZiLbEEKSlwCl3smHkEAnHrG6BRDWBuNXOouC5LpYRgM,476
|
|
@@ -73,6 +74,7 @@ otrs_somconnexio/otrs_models/ticket_types/change_tariff_adsl_ticket.py,sha256=A8
|
|
|
73
74
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_fiber_ticket.py,sha256=DWHsB3pl-4AtpzST5fmAMZjmHqAgI_JrSrqv3oFAc20,1362
|
|
74
75
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket.py,sha256=eLJh0pmwsbl4Em0eKdvUpkdNgn5MmO5DG7kxg0PFwP4,2659
|
|
75
76
|
otrs_somconnexio/otrs_models/ticket_types/change_tariff_ticket_shared_bonds.py,sha256=fPg4qXHyt39motD0qEc6ou5FKpBKpkGQUGUJS_95BLk,2021
|
|
77
|
+
otrs_somconnexio/otrs_models/ticket_types/check_coverage_ticket.py,sha256=mHMx4eNo8rq0b5kf8ay0tTcziweS82D2O4N-atNWYv4,1866
|
|
76
78
|
otrs_somconnexio/otrs_models/ticket_types/we_call_you_ticket.py,sha256=o4_XkkNVbL31yt0wevdrHnXTc3ANYi8KF19BLTu7bP8,1205
|
|
77
79
|
otrs_somconnexio/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
78
80
|
otrs_somconnexio/responses/ticket_creation.py,sha256=32Iigeg2TO422M2XYaiei57KpimnkB1tgnIexiEhi-E,735
|
|
@@ -149,6 +151,7 @@ tests/otrs_models/ticket_types/test_change_tariff_adsl_landline.py,sha256=bBZw0z
|
|
|
149
151
|
tests/otrs_models/ticket_types/test_change_tariff_adsl_out_landline.py,sha256=c0dO23z3wnEFYQVU27yi9s8tRsB1aUf4YIxWEG48GGc,4609
|
|
150
152
|
tests/otrs_models/ticket_types/test_change_tariff_fiber.py,sha256=K_1qFai00CopyQTEFgltupBYN2rhMh5tJDA_DC01624,6741
|
|
151
153
|
tests/otrs_models/ticket_types/test_change_tariff_shared_bonds.py,sha256=JRzXGh0BoYpEqRn53J_xSq0gL01VbbSI_I4TyICnnBI,5435
|
|
154
|
+
tests/otrs_models/ticket_types/test_check_coverage.py,sha256=o6fVO52WxvrVahIQNscP7LhcQIe2iEK7q0yI9JT3-3Q,4158
|
|
152
155
|
tests/otrs_models/ticket_types/test_shared_bond.py,sha256=Ha1sCIOkov-u7r7nijNqlSZsXYYNoOGV3pm7Fqx1YcU,3177
|
|
153
156
|
tests/otrs_models/ticket_types/test_we_call_you.py,sha256=_1GEYnFNCx6KA_6-EKoX081_QItLtqZ7QEX3PLVbS5Q,2891
|
|
154
157
|
tests/responses/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -173,7 +176,7 @@ tests/services/test_update_ticket_with_provider_info.py,sha256=cZUg-hNV4BoMwafbp
|
|
|
173
176
|
tests/user_management_client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
174
177
|
tests/user_management_client/test_client.py,sha256=088q9H1yf8Hii7zUF17KULqOO-JCxJLsR7vQ8lGHiqg,4410
|
|
175
178
|
tests/user_management_client/test_user_management_response.py,sha256=HCCG7i2f6-ytrRpTzYZHODKCdW-X5GJn-BMVegd5FXg,1539
|
|
176
|
-
otrs_somconnexio-0.5.
|
|
177
|
-
otrs_somconnexio-0.5.
|
|
178
|
-
otrs_somconnexio-0.5.
|
|
179
|
-
otrs_somconnexio-0.5.
|
|
179
|
+
otrs_somconnexio-0.5.12.dist-info/METADATA,sha256=xpFR8Dp-kn-oQucFxP8-tIbPTL7hSnbNFvvOeMqz2sA,3459
|
|
180
|
+
otrs_somconnexio-0.5.12.dist-info/WHEEL,sha256=fS9sRbCBHs7VFcwJLnLXN1MZRR0_TVTxvXKzOnaSFs8,110
|
|
181
|
+
otrs_somconnexio-0.5.12.dist-info/top_level.txt,sha256=gvMaHGNwusWpSIy-PVyb0CKDIA4-4fXmEVER_2a-OnE,23
|
|
182
|
+
otrs_somconnexio-0.5.12.dist-info/RECORD,,
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
from otrs_somconnexio.otrs_models.configurations.querys.check_coverage import (
|
|
2
|
+
CheckCoverageCATConfiguration,
|
|
3
|
+
CheckCoverageESConfiguration,
|
|
4
|
+
)
|
|
5
|
+
from otrs_somconnexio.otrs_models.ticket_types.check_coverage_ticket import (
|
|
6
|
+
CheckCoverageTicket,
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class TestCaseCheckCoverage:
|
|
11
|
+
fields_dict = {
|
|
12
|
+
"name": "name",
|
|
13
|
+
"surnames": "sunames",
|
|
14
|
+
"email": "som@com.com",
|
|
15
|
+
"phone": "642525377",
|
|
16
|
+
"contact_lang": "ca_ES",
|
|
17
|
+
"road_type": "carrer",
|
|
18
|
+
"road_name": "melancolia",
|
|
19
|
+
"road_number": "6",
|
|
20
|
+
"block": "A",
|
|
21
|
+
"doorway": "B",
|
|
22
|
+
"floor": "3",
|
|
23
|
+
"scale": "A",
|
|
24
|
+
"door": "10",
|
|
25
|
+
"other_information": "Altra info",
|
|
26
|
+
"locality": "Alcobendas",
|
|
27
|
+
"state": "Wisconsin",
|
|
28
|
+
"zip_code": "46870",
|
|
29
|
+
"language": "ca_ES",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
def test_create_CAT(self, mocker):
|
|
33
|
+
self._execute_and_assert_create(mocker, CheckCoverageCATConfiguration)
|
|
34
|
+
|
|
35
|
+
def test_create_ES(self, mocker):
|
|
36
|
+
self.fields_dict["language"] = "es_ES"
|
|
37
|
+
self._execute_and_assert_create(mocker, CheckCoverageESConfiguration)
|
|
38
|
+
|
|
39
|
+
def _execute_and_assert_create(self, mocker, config):
|
|
40
|
+
OTRSClientMock = mocker.patch(
|
|
41
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.OTRSClient",
|
|
42
|
+
return_value=mocker.Mock(),
|
|
43
|
+
)
|
|
44
|
+
TicketMock = mocker.patch(
|
|
45
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.Ticket",
|
|
46
|
+
return_value=mocker.Mock(),
|
|
47
|
+
)
|
|
48
|
+
DynamicFieldMock = mocker.patch(
|
|
49
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.DynamicField",
|
|
50
|
+
return_value=mocker.Mock(),
|
|
51
|
+
)
|
|
52
|
+
ArticleMock = mocker.patch(
|
|
53
|
+
"otrs_somconnexio.otrs_models.ticket_types.base_ticket.Article",
|
|
54
|
+
return_value=mocker.Mock(),
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
expected_ticket_data = {
|
|
58
|
+
"Title": config.subject,
|
|
59
|
+
"QueueID": config.queue_id,
|
|
60
|
+
"State": config.state,
|
|
61
|
+
"Type": config.type,
|
|
62
|
+
"Priority": config.priority,
|
|
63
|
+
"CustomerUser": "customer",
|
|
64
|
+
"CustomerID": "customer",
|
|
65
|
+
}
|
|
66
|
+
expected_article_data = {
|
|
67
|
+
"Subject": config.subject,
|
|
68
|
+
"Body": "-",
|
|
69
|
+
}
|
|
70
|
+
calls = [
|
|
71
|
+
mocker.call("ProcessManagementProcessID", config.process_id),
|
|
72
|
+
mocker.call(
|
|
73
|
+
"ProcessManagementActivityID",
|
|
74
|
+
config.activity_id,
|
|
75
|
+
),
|
|
76
|
+
mocker.call("nomSoci", self.fields_dict["name"]),
|
|
77
|
+
mocker.call("cognom1", self.fields_dict["surnames"]),
|
|
78
|
+
mocker.call("correuElectronic", self.fields_dict["email"]),
|
|
79
|
+
mocker.call("telefonContacte", self.fields_dict["phone"]),
|
|
80
|
+
mocker.call("idioma", self.fields_dict["contact_lang"]),
|
|
81
|
+
mocker.call("tipusVia", self.fields_dict["road_type"]),
|
|
82
|
+
mocker.call("nomVia", self.fields_dict["road_name"]),
|
|
83
|
+
mocker.call("numero", self.fields_dict["road_number"]),
|
|
84
|
+
mocker.call("bloc", self.fields_dict["block"]),
|
|
85
|
+
mocker.call("portal", self.fields_dict["doorway"]),
|
|
86
|
+
mocker.call("pis", self.fields_dict["floor"]),
|
|
87
|
+
mocker.call("escala", self.fields_dict["scale"]),
|
|
88
|
+
mocker.call("porta", self.fields_dict["door"]),
|
|
89
|
+
mocker.call("altresCobertura", self.fields_dict["other_information"]),
|
|
90
|
+
mocker.call("poblacioServei", self.fields_dict["locality"]),
|
|
91
|
+
mocker.call("provinciaServei", self.fields_dict["state"]),
|
|
92
|
+
mocker.call("CPservei", self.fields_dict["zip_code"]),
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
CheckCoverageTicket(None, "customer", self.fields_dict, [], "").create()
|
|
96
|
+
|
|
97
|
+
TicketMock.assert_called_once_with(expected_ticket_data)
|
|
98
|
+
ArticleMock.assert_called_once_with(expected_article_data)
|
|
99
|
+
DynamicFieldMock.assert_has_calls(calls)
|
|
100
|
+
OTRSClientMock.return_value.create_otrs_process_ticket.assert_called_once_with(
|
|
101
|
+
TicketMock.return_value,
|
|
102
|
+
article=ArticleMock.return_value,
|
|
103
|
+
dynamic_fields=[mocker.ANY for call in calls],
|
|
104
|
+
attachments=None,
|
|
105
|
+
)
|
|
File without changes
|
|
File without changes
|