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

chift-oneapi / chift-python-sdk / 6786875963

07 Nov 2023 03:44PM UTC coverage: 99.032%. First build
6786875963

Pull #22

github

web-flow
Merge bc754f425 into c1e063f63
Pull Request #22: [0.1.23] fix accounting/invoices params

14 of 16 new or added lines in 3 files covered. (87.5%)

2864 of 2892 relevant lines covered (99.03%)

0.99 hits per line

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

96.0
/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
def test_find_one_evoliz_connection(chift):
1✔
8
    consumers = chift.Consumer.all()
1✔
9

10
    for consumer in consumers:
1✔
11
        connections = consumer.Connection.all()
1✔
12

13
        for connection in connections:
1✔
14
            if connection.integration == "Evoliz":
1✔
15
                return
1✔
16

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

19

20
def test_multi_connections(two_connections_consumer: Consumer):
1✔
21
    # a consumer with 2 connections
22
    consumer = two_connections_consumer
1✔
23

24
    # will raise if no connectionid is set
25
    with pytest.raises(ChiftException) as e:
1✔
26
        consumer.invoicing.Invoice.all()
1✔
27

28
    assert e.value.message == "The connection is not correctly configured"
1✔
29

30
    connections = consumer.Connection.all()
1✔
31
    active_connection = list(
1✔
32
        filter(lambda conn: conn.status.value == "active", connections)
33
    )
34

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

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

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