pyaterochka-api 0.1.9__py3-none-any.whl → 0.1.9.1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaterochka_api
3
- Version: 0.1.9
3
+ Version: 0.1.9.1
4
4
  Summary: A Python API client for Pyaterochka store catalog
5
5
  Home-page: https://github.com/Open-Inflation/pyaterochka_api
6
6
  Author: Miskler
@@ -0,0 +1,10 @@
1
+ pyaterochka_api/__init__.py,sha256=6XnalFPUumYqDJFyXw2puejJ612o-D1tYjZ_IjQ7Hx0,108
2
+ pyaterochka_api/api.py,sha256=KEr28n1aH69cVo0ztHCgB4ANVVZ-CezLWYTiPpfAmoc,7793
3
+ pyaterochka_api/enums.py,sha256=JnX4JiHzXyRo4se8sCFx0LyqcKlXXED0VcA0xI7r_ZI,621
4
+ pyaterochka_api/manager.py,sha256=yQw0njGCsropysT-_siuyNxXNpX-VJKOcVD8b-aV48I,10765
5
+ pyaterochka_api/tools.py,sha256=xFOThNRClX4u0cMfmQ5fVQKLM2Fn-rBAekzo_yBvRnQ,4447
6
+ pyaterochka_api-0.1.9.1.dist-info/licenses/LICENSE,sha256=Ee_P5XQUYoJuffzRL24j4GWpqgoWphUOKswpB2f9HcQ,1071
7
+ pyaterochka_api-0.1.9.1.dist-info/METADATA,sha256=ZQOhWOFzmF9nr2LfutfAVfgkzorB_OYb4sJmtpHtruI,9857
8
+ pyaterochka_api-0.1.9.1.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
9
+ pyaterochka_api-0.1.9.1.dist-info/top_level.txt,sha256=NTJa4yZBzfmC9B5FQuFETD9ngGd_KYZ3Hjfw_33aDTE,16
10
+ pyaterochka_api-0.1.9.1.dist-info/RECORD,,
@@ -1,13 +0,0 @@
1
- pyaterochka_api/__init__.py,sha256=6XnalFPUumYqDJFyXw2puejJ612o-D1tYjZ_IjQ7Hx0,108
2
- pyaterochka_api/api.py,sha256=KEr28n1aH69cVo0ztHCgB4ANVVZ-CezLWYTiPpfAmoc,7793
3
- pyaterochka_api/enums.py,sha256=JnX4JiHzXyRo4se8sCFx0LyqcKlXXED0VcA0xI7r_ZI,621
4
- pyaterochka_api/manager.py,sha256=yQw0njGCsropysT-_siuyNxXNpX-VJKOcVD8b-aV48I,10765
5
- pyaterochka_api/tools.py,sha256=xFOThNRClX4u0cMfmQ5fVQKLM2Fn-rBAekzo_yBvRnQ,4447
6
- pyaterochka_api-0.1.9.dist-info/licenses/LICENSE,sha256=Ee_P5XQUYoJuffzRL24j4GWpqgoWphUOKswpB2f9HcQ,1071
7
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- tests/api_tests.py,sha256=Sx2tAVGLbubpzJOn166ECJj64oYUv1S6c5fYfGLGvu0,2227
9
- tests/tools_tests.py,sha256=UKWVHu-QkEzc7iLsm5wIhA17FLq3E7SxwkLHc5GEI2M,1040
10
- pyaterochka_api-0.1.9.dist-info/METADATA,sha256=nUC4TfS_mT1VQ2MZLKNpLM4YF1ZfvaZ33bqOHhimHZk,9855
11
- pyaterochka_api-0.1.9.dist-info/WHEEL,sha256=zaaOINJESkSfm_4HQVc5ssNzHCPXhJm0kEUakpsEHaU,91
12
- pyaterochka_api-0.1.9.dist-info/top_level.txt,sha256=PXTSi8y2C5_Mz20pJJFqOUBnjAIAXP_cc38mthvJ2x4,22
13
- pyaterochka_api-0.1.9.dist-info/RECORD,,
tests/__init__.py DELETED
File without changes
tests/api_tests.py DELETED
@@ -1,57 +0,0 @@
1
- import pytest
2
- from pyaterochka_api import Pyaterochka
3
- from io import BytesIO
4
- from typed_schema_shot import SchemaShot
5
-
6
-
7
- @pytest.mark.asyncio
8
- async def test_list(schemashot: SchemaShot):
9
- async with Pyaterochka(debug=True, trust_env=True) as API:
10
- categories = await API.categories_list(subcategories=True)
11
- schemashot.assert_match(categories, "categories_list")
12
-
13
- result = await API.products_list(category_id=categories[0]['id'], limit=5)
14
- schemashot.assert_match(result, "products_list")
15
-
16
- @pytest.mark.asyncio
17
- async def test_product_info(schemashot: SchemaShot):
18
- async with Pyaterochka(trust_env=True) as API:
19
- result = await API.product_info(43347)
20
- schemashot.assert_match(result, "product_info")
21
-
22
- @pytest.mark.asyncio
23
- async def test_get_news(schemashot: SchemaShot):
24
- async with Pyaterochka(debug=True, trust_env=True) as API:
25
- result = await API.get_news(limit=5)
26
- schemashot.assert_match(result, "get_news")
27
-
28
- @pytest.mark.asyncio
29
- async def test_find_store(schemashot: SchemaShot):
30
- async with Pyaterochka(debug=True, trust_env=True) as API:
31
- categories = await API.find_store(longitude=37.63156, latitude=55.73768)
32
- schemashot.assert_match(categories, "store_info")
33
-
34
- @pytest.mark.asyncio
35
- async def test_download_image(schemashot: SchemaShot):
36
- async with Pyaterochka(debug=True, trust_env=True) as API:
37
- result = await API.download_image("https://photos.okolo.app/product/1392827-main/800x800.jpeg")
38
- assert isinstance(result, BytesIO)
39
- assert result.getvalue()
40
-
41
- @pytest.mark.asyncio
42
- async def test_set_debug(schemashot: SchemaShot):
43
- async with Pyaterochka(debug=True) as API:
44
- assert API.debug == True
45
- API.debug = False
46
- assert API.debug == False
47
-
48
- @pytest.mark.asyncio
49
- async def test_rebuild_connection(schemashot: SchemaShot):
50
- async with Pyaterochka(debug=True, trust_env=True) as API:
51
- await API.rebuild_connection()
52
-
53
- #@pytest.mark.asyncio
54
- #async def test_get_config(snapshot: SnapshotTest):
55
- # async with Pyaterochka(debug=True, trust_env=True, timeout=30) as API:
56
- # result = await API.get_config()
57
- # snapshot.assert_match(gen_schema(result), "get_config")
tests/tools_tests.py DELETED
@@ -1,30 +0,0 @@
1
- import pytest
2
- from pyaterochka_api.tools import parse_proxy
3
- import itertools
4
- import logging
5
-
6
- @pytest.mark.asyncio
7
- async def test_parse_proxy():
8
- # Варианты параметров
9
- schemes = ['http://', 'https://', '']
10
- auths = [('', ''), ('user', 'pass')]
11
- hosts = ['127.0.0.1', 'example.com']
12
- ports = ['', '8080']
13
-
14
- logger = logging.getLogger("test_parse_proxy")
15
-
16
- for scheme, (username, password), host, port in itertools.product(schemes, auths, hosts, ports):
17
- # Формируем строку прокси
18
- auth_part = f"{username}:{password}@" if username else ""
19
- port_part = f":{port}" if port else ""
20
- proxy_str = f"{scheme}{auth_part}{host}{port_part}"
21
-
22
- expected = {'server': f"{scheme}{host}{port_part}"}
23
- if not scheme:
24
- expected['server'] = "http://"+expected['server']
25
- if username:
26
- expected['username'] = username
27
- expected['password'] = password
28
-
29
- assert parse_proxy(proxy_str, True, logger) == expected
30
-