Skip to content

Commit

Permalink
fix EV tests based on current set of default example data
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Herrmann committed Sep 5, 2024
1 parent d2c26fc commit 8402715
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions tests/test_contact_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def test_get_contact_details(self, ev_connection: EasyvereinAPI):
# Check if the response is a list
assert isinstance(contact_details, list)

# We should have 6 invoices based on the example data
assert total_count == 10
assert len(contact_details) == 10
# We should have contacts based on the example data
assert total_count == 8
assert len(contact_details) == 8

# Check if all the members are of type Member
for contact_detail in contact_details:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def validate_response(response: tuple[list[Any], int], model: type, num_expected
assert isinstance(instance, model)

def test_filter_invoices(self, ev_connection: EasyvereinAPI):
search = InvoiceFilter(invNumber__in=["10", "11"], canceledInvoice__isnull=True, isDraft=False)
search = InvoiceFilter(invNumber__in=["32", "33"], canceledInvoice__isnull=True, isDraft=False)

TestFilter.validate_response(ev_connection.invoice.get(search=search), Invoice, 2)

Expand All @@ -39,7 +39,7 @@ def test_filter_members(self, ev_connection: EasyvereinAPI):

# Case 3: search by name
search = MemberFilter(search="Mustermann")
TestFilter.validate_response(ev_connection.member.get(search=search), Member, 2)
TestFilter.validate_response(ev_connection.member.get(search=search), Member, 1)

# Case 4: test bool, get chairmans
search = MemberFilter(isChairman=True)
Expand Down
10 changes: 5 additions & 5 deletions tests/test_member.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ def test_get_members(self, ev_connection: EasyvereinAPI):
# Check if the response is a list
assert isinstance(members, list)

# We should have 8 members based on the example data
# 5 regular members, 3 requests
assert total_count == 8
assert len(members) == 8
# We should have 5 members based on the example data
# 4 regular members, 1 requests
assert total_count == 5
assert len(members) == 5

# Check if all the members are of type Member
for member in members:
Expand All @@ -28,7 +28,7 @@ def test_members_with_query(self, ev_connection: EasyvereinAPI):

members, total_count = ev_connection.member.get(query=query, limit=2)
assert len(members) == 2
assert total_count == 8
assert total_count == 5

for member in members:
assert isinstance(member, Member)
Expand Down

0 comments on commit 8402715

Please sign in to comment.