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

chift-oneapi / chift-python-sdk / 15276047364

27 May 2025 01:04PM UTC coverage: 94.743% (-0.09%) from 94.83%
15276047364

Pull #43

github

web-flow
Merge 9fe4affd8 into 22d9be47e
Pull Request #43: feat: allow requesting raw-data

7 of 11 new or added lines in 2 files covered. (63.64%)

3857 of 4071 relevant lines covered (94.74%)

0.95 hits per line

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

93.22
/tests/conftest.py
1
import os
1✔
2
import uuid
1✔
3

4
import pytest
1✔
5

6
import chift as package
1✔
7
from chift.api.client import ChiftClient
1✔
8
from chift.openapi.models import Consumer
1✔
9

10

11
@pytest.fixture
1✔
12
def chift():
1✔
13
    package.client_secret = os.environ.get("CHIFT_TESTING_CLIENTSECRET", "unit")
1✔
14
    package.client_id = os.environ.get("CHIFT_TESTING_CLIENTID", "unit")
1✔
15
    package.account_id = os.environ.get("CHIFT_TESTING_ACCOUNTID", "unit")
1✔
16
    package.url_base = os.environ.get("CHIFT_BACKBONE_API", "unit")
1✔
17
    return package
1✔
18

19

20
@pytest.fixture
1✔
21
def evoliz_consumer(chift):
1✔
22
    # get evoliz connection
23
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
24
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
×
25

26

27
@pytest.fixture
1✔
28
def pennylane_consumer(chift):
1✔
29
    # get pennylane v2 connection
30
    # return chift.Consumer.get("e7a0051b-b314-4961-861d-3b65749fd33b")
31
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
32

33

34
@pytest.fixture
1✔
35
def accounting_consumer(chift):
1✔
36
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
37
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
38

39

40
@pytest.fixture
1✔
41
def pos_consumer(chift):
1✔
42
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
43
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
44

45

46
@pytest.fixture
1✔
47
def ecommerce_consumer(chift):
1✔
48
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
49
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
50

51

52
@pytest.fixture
1✔
53
def payment_consumer(chift):
1✔
54
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
55
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
56

57

58
@pytest.fixture
1✔
59
def custom_regate_consumer(chift):
1✔
60
    # return chift.Consumer.get("0740d8ad-1920-48c6-8909-c0ea8f8be19e")
61
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
×
62

63

64
@pytest.fixture
1✔
65
def two_connections_consumer(chift):
1✔
66
    # get consumer wth 2 connections for one vertical
67
    # return chift.Consumer.get("46ec75e8-4d79-4d63-8e96-99d2c924d89a")
68
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
69

70

71
@pytest.fixture
1✔
72
def invoicing_consumer(chift):
1✔
73
    return Consumer(consumerid=uuid.uuid4(), name="Consumer")
1✔
74

75

76
@pytest.fixture(autouse=True)
1✔
77
def _patch_chift_client(monkeypatch, request):
1✔
78
    marker = request.node.get_closest_marker("mock_chift_response")
1✔
79
    if not marker:
1✔
80
        return
×
81
    raw = marker.args
1✔
82
    if len(raw) == 1 and isinstance(raw[0], (list, tuple)):
1✔
83
        responses = list(raw[0])
×
84
    else:
85
        responses = list(raw)
1✔
86
    iterator = iter(responses)
1✔
87

88
    def fake_make_request(self, method, path, **kw):
1✔
89
        try:
1✔
90
            resp = next(iterator)
1✔
91
        except StopIteration:
1✔
92
            resp = responses[-1]
1✔
93
        if isinstance(resp, Exception):
1✔
94
            raise resp
1✔
95
        return resp
1✔
96

97
    monkeypatch.setattr(ChiftClient, "make_request", fake_make_request)
1✔
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

© 2025 Coveralls, Inc