odoo-somconnexio-python-client 0.1.44__tar.gz → 0.1.45__tar.gz
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.
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/PKG-INFO +1 -1
- odoo-somconnexio-python-client-0.1.45/odoo_somconnexio_python_client/__init__.py +1 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/product_catalog.py +23 -2
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/PKG-INFO +1 -1
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_product_catalog.py +24 -15
- odoo-somconnexio-python-client-0.1.44/odoo_somconnexio_python_client/__init__.py +0 -1
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/LICENSE +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/README.md +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/client.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/exceptions.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/helpers.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/__init__.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/address.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/broadband_isp_info.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/contract.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/coop_agreement.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/crm_lead.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/crm_lead_line.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/discovery_channel.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/fiber_contracts.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/invoice.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/knowledge.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/mobile_isp_info.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/odoo_paging.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/one_shot_catalog.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/partner.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/provider.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/sponsees.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client/resources/subscription_request.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/SOURCES.txt +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/dependency_links.txt +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/not-zip-safe +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/requires.txt +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/odoo_somconnexio_python_client.egg-info/top_level.txt +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/setup.cfg +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/setup.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/__init__.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_address.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_contract.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_coop_agreement.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_crm_lead.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_discovery_channel.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_fiber_contracts.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_invoice.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_knowledge.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_one_shot_catalog.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_partner.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_providers.py +0 -0
- {odoo-somconnexio-python-client-0.1.44 → odoo-somconnexio-python-client-0.1.45}/tests/resources/test_subscription_request.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.45"
|
|
@@ -72,11 +72,32 @@ class ProductCatalog:
|
|
|
72
72
|
self.packs = [Pack(**pack) for pack in packs]
|
|
73
73
|
|
|
74
74
|
@classmethod
|
|
75
|
-
def search(cls, code="", category="", lang="ca",
|
|
75
|
+
def search(cls, code="", category="", lang="ca", is_company="false"):
|
|
76
|
+
return cls._get_product_catalog(
|
|
77
|
+
{
|
|
78
|
+
"code": code,
|
|
79
|
+
"categ": category,
|
|
80
|
+
"is_company": is_company,
|
|
81
|
+
},
|
|
82
|
+
lang,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def get_by_product_code(cls, code="", lang="ca", product_code=""):
|
|
87
|
+
return cls._get_product_catalog(
|
|
88
|
+
{
|
|
89
|
+
"code": code,
|
|
90
|
+
"product_code": product_code,
|
|
91
|
+
},
|
|
92
|
+
lang,
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def _get_product_catalog(cls, params, lang):
|
|
76
97
|
headers = {"Accept-Language": lang}
|
|
77
98
|
response_data = Client().get(
|
|
78
99
|
cls._url_path,
|
|
79
|
-
params={
|
|
100
|
+
params={**params},
|
|
80
101
|
extra_headers=headers,
|
|
81
102
|
)
|
|
82
103
|
|
|
@@ -28,7 +28,7 @@ class TariffTests(unittest.TestCase):
|
|
|
28
28
|
tariff_names.append(product.name)
|
|
29
29
|
tariff_codes.append(product.code)
|
|
30
30
|
tariff_available_for.append(product.available_for)
|
|
31
|
-
if product.code == "
|
|
31
|
+
if product.code == "SE_SC_REC_MOBILE_T_UNL_30720":
|
|
32
32
|
tariff_offer = product.offer
|
|
33
33
|
|
|
34
34
|
self.assertIn("ADSL sense fix", tariff_names)
|
|
@@ -36,9 +36,9 @@ class TariffTests(unittest.TestCase):
|
|
|
36
36
|
self.assertIn(["member"], tariff_available_for)
|
|
37
37
|
|
|
38
38
|
self.assertIsInstance(tariff_offer, Offer)
|
|
39
|
-
self.assertIn("
|
|
40
|
-
self.assertIn("Il·limitades
|
|
41
|
-
self.assertEqual(
|
|
39
|
+
self.assertIn("SE_SC_REC_MOBILE_PACK_UNL_30720", tariff_offer.code)
|
|
40
|
+
self.assertIn("Il·limitades 30 GB (Pack)", tariff_offer.name)
|
|
41
|
+
self.assertEqual(1.0, tariff_offer.price)
|
|
42
42
|
|
|
43
43
|
adsl_wo_fix_product = list(
|
|
44
44
|
filter(lambda p: p.code == "SE_SC_REC_BA_ADSL_SF", pricelist_21IVA.products)
|
|
@@ -73,11 +73,11 @@ class TariffTests(unittest.TestCase):
|
|
|
73
73
|
pack_tariff_codes.append(product.code)
|
|
74
74
|
|
|
75
75
|
self.assertIn("SE_SC_REC_PACK_FIBER_100_UNL_20480", pack_codes)
|
|
76
|
-
self.assertIn("Fibra
|
|
77
|
-
self.assertIn("Fibra
|
|
76
|
+
self.assertIn("Fibra 1Gb + Fix + 50 GB compartides 2 mòbils", pack_names)
|
|
77
|
+
self.assertIn("Fibra 300Mb Sense Fix", pack_tariff_names)
|
|
78
78
|
self.assertIn("SE_SC_REC_MOBILE_PACK_UNL_20480", pack_tariff_codes)
|
|
79
|
-
self.assertIn(
|
|
80
|
-
self.assertIn(
|
|
79
|
+
self.assertIn(2, pack_mobiles_in_pack)
|
|
80
|
+
self.assertIn(100, pack_fiber_bandwidth)
|
|
81
81
|
|
|
82
82
|
@pytest.mark.vcr()
|
|
83
83
|
def test_search_non_existant_code(self):
|
|
@@ -104,15 +104,24 @@ class TariffTests(unittest.TestCase):
|
|
|
104
104
|
ca_product_names = [p.name for p in ca_pricelists[0].products]
|
|
105
105
|
es_product_names = [p.name for p in es_pricelists[0].products]
|
|
106
106
|
|
|
107
|
-
self.assertIn("Il·limitades
|
|
108
|
-
self.assertIn("Ilimitadas
|
|
107
|
+
self.assertIn("Il·limitades 30 GB", ca_product_names)
|
|
108
|
+
self.assertIn("Ilimitadas 30 GB", es_product_names)
|
|
109
109
|
|
|
110
110
|
@pytest.mark.vcr()
|
|
111
|
-
def
|
|
111
|
+
def test_get_by_product_code(self):
|
|
112
112
|
"""For product fibra 100Mb only are available other Fiber products."""
|
|
113
|
-
pricelists = ProductCatalog.
|
|
113
|
+
pricelists = ProductCatalog.get_by_product_code(
|
|
114
|
+
product_code="SE_SC_REC_BA_F_100"
|
|
115
|
+
)
|
|
116
|
+
product_codes = [p.code for p in pricelists[0].products]
|
|
117
|
+
|
|
118
|
+
self.assertIn("SE_SC_REC_BA_F_100_SF", product_codes)
|
|
119
|
+
|
|
120
|
+
@pytest.mark.vcr()
|
|
121
|
+
def test_search_company_catalog(self):
|
|
122
|
+
pricelists = ProductCatalog.search(is_company="true")
|
|
114
123
|
product_codes = [p.code for p in pricelists[0].products]
|
|
124
|
+
pack_codes = [p.code for p in pricelists[0].packs]
|
|
115
125
|
|
|
116
|
-
self.assertIn("
|
|
117
|
-
self.assertIn("
|
|
118
|
-
self.assertNotIn("SE_SC_REC_BA_ADSL_SF", product_codes)
|
|
126
|
+
self.assertIn("SE_SC_REC_MOBILE_T_UNL_30720", product_codes)
|
|
127
|
+
self.assertIn("SE_SC_REC_PACK_FIBER_1000_2_MOBILES_50", pack_codes)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.44"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|