Skip to content

Add cached property for service points (#142) - #143

Merged
btravisebsco merged 3 commits into
masterfrom
feature/add-cached-property-for-service-points-142
Jul 29, 2026
Merged

Add cached property for service points (#142)#143
btravisebsco merged 3 commits into
masterfrom
feature/add-cached-property-for-service-points-142

Conversation

@btravisebsco

Copy link
Copy Markdown

Summary

Closes #142

Adds a service_points cached property to FolioClient, mirroring the existing locations cached property pattern. This avoids redundant HTTP calls when service point data is accessed in multiple contexts (e.g. validating defaults, mapping values, and resolving service point names during circulation workflows).

Changes

  • src/folioclient/FolioClient.py: Added @cached_property service_points fetching from /service-points with the servicepoints record key, using the same folio_get_all + cql_all pattern as locations.
  • tests/test_folio_client.py: Added test_service_points_cached_property — verifies the correct endpoint/key are used and that the result is cached after the first call (i.e. folio_get_all is called only once across multiple accesses).
  • tests/integration_tests.py: Added test_service_points_cached_property to TestCachedProperties — verifies consistency and identity of the cached value against live environments, with graceful skips for FolioPermissionError and FolioResourceNotFoundError.

Test results

  • Unit test: 1 passed
  • Integration test (snapshot): 1 passed across all reachable environments; one environment (snapshot-2-eureka) was unreachable at time of testing (DNS/connectivity error, pre-existing infra issue).

Comment thread src/folioclient/FolioClient.py Fixed
@sonarqubecloud

sonarqubecloud Bot commented Jul 29, 2026

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
5 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@btravisebsco
btravisebsco merged commit c1d3bc2 into master Jul 29, 2026
7 checks passed
@btravisebsco
btravisebsco deleted the feature/add-cached-property-for-service-points-142 branch July 29, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cached property for service points

3 participants