Skip to content

Commit

Permalink
fix: call base class method to circumvent the cache
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTheWizardL committed Aug 5, 2024
1 parent ee37248 commit 05262a7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
7 changes: 3 additions & 4 deletions tests/test_cached_account_categories.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for cached account categories."""

import time
from cashctrl_api import CachedCashCtrlClient
from cashctrl_api import CachedCashCtrlClient, CashCtrlClient
import pandas as pd
import pytest

Expand All @@ -12,10 +12,9 @@ def cc_client():


@pytest.fixture(scope="module")
def account_categories():
def account_categories(cc_client):
# Explicitly call the base class method to circumvent the cache.
cc_client = CachedCashCtrlClient()
return cc_client.list_categories("account", include_system=True)
return CashCtrlClient.list_categories(cc_client, "account", include_system=True)


def test_account_categories_cache_is_none_on_init(cc_client):
Expand Down
7 changes: 3 additions & 4 deletions tests/test_cached_accounts.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for cached accounts."""

import time
from cashctrl_api import CachedCashCtrlClient
from cashctrl_api import CachedCashCtrlClient, CashCtrlClient
import pandas as pd
import pytest

Expand All @@ -12,10 +12,9 @@ def cc_client():


@pytest.fixture(scope="module")
def accounts():
def accounts(cc_client):
# Explicitly call the base class method to circumvent the cache.
cc_client = CachedCashCtrlClient()
return cc_client.list_accounts()
return CashCtrlClient.list_accounts(cc_client)


def test_account_cache_is_none_on_init(cc_client):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cached_journal_entries.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for cached journal entries."""

import time
from cashctrl_api import CachedCashCtrlClient
from cashctrl_api import CachedCashCtrlClient, CashCtrlClient
import pandas as pd
import pytest

Expand All @@ -14,7 +14,7 @@ def cc_client() -> CachedCashCtrlClient:
@pytest.fixture(scope="module")
def journal_entries(cc_client):
# Explicitly call the base class method to circumvent the cache.
return cc_client.list_journal_entries()
return CashCtrlClient.list_journal_entries(cc_client)


def test_journal_cache_is_none_on_init(cc_client):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cached_tax_rates.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit tests for cached tax codes."""

import time
from cashctrl_api import CachedCashCtrlClient
from cashctrl_api import CachedCashCtrlClient, CashCtrlClient
import pandas as pd
import pytest

Expand All @@ -14,7 +14,7 @@ def cc_client() -> CachedCashCtrlClient:
@pytest.fixture(scope="module")
def tax_rates(cc_client):
# Explicitly call the base class method to circumvent the cache.
return cc_client.list_tax_rates()
return CashCtrlClient.list_tax_rates(cc_client)


def test_tax_rates_cache_is_none_on_init(cc_client):
Expand Down

0 comments on commit 05262a7

Please sign in to comment.