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

chift-oneapi / chift-python-sdk / 15810519605

22 Jun 2025 08:23PM UTC coverage: 94.823%. Remained the same
15810519605

push

github

hhertoghe
fix (pagination): make sure it stops

1 of 1 new or added line in 1 file covered. (100.0%)

4011 of 4230 relevant lines covered (94.82%)

0.95 hits per line

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

25.93
/tests/test_connection.py
1
import pytest
1✔
2

3
from chift.api.exceptions import ChiftException
1✔
4
from chift.openapi.models import Consumer
1✔
5

6

7
@pytest.mark.skip(reason="no evoliz connection in test environment")
1✔
8
def test_find_one_evoliz_connection(chift):
1✔
9
    consumers = chift.Consumer.all()
×
10

11
    for consumer in consumers:
×
12
        connections = consumer.Connection.all()
×
13

14
        for connection in connections:
×
15
            if connection.integration == "Evoliz":
×
16
                return
×
17

18
    raise Exception("No connection found for Evoliz.")
×
19

20

21
@pytest.mark.skip(reason="dont make sens in unit testing")
1✔
22
def test_multi_connections(two_connections_consumer: Consumer):
1✔
23
    # a consumer with 2 connections
24
    consumer = two_connections_consumer
×
25

26
    # will raise if no connectionid is set
27
    with pytest.raises(ChiftException) as e:
×
28
        consumer.invoicing.Invoice.all()
×
29

30
    assert e.value.message == "The connection is not correctly configured"
×
31

32
    connections = consumer.Connection.all()
×
33
    active_connection = list(
×
34
        filter(lambda conn: conn.status.value == "active", connections)
35
    )
36

37
    # will find invoices if one of the consumers set
38
    consumer.connectionid = str(active_connection[0].connectionid)
×
39
    invoices = consumer.invoicing.Invoice.all()
×
40
    invoice = invoices[0]
×
41

42
    # will raise if we try to find the invoice of one connection in the other
43
    consumer.connectionid = str(active_connection[1].connectionid)
×
44
    with pytest.raises(ChiftException) as e:
×
45
        consumer.invoicing.Invoice.get(invoice.id)
×
46

47
    assert e.value.message == "The invoice doesn't exist."
×
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