• 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

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