Skip to content

test: add tests for search() and NutriPatrolResource#488

Open
saivats wants to merge 2 commits into
openfoodfacts:developfrom
saivats:test/add-search-and-nutripatrol-tests
Open

test: add tests for search() and NutriPatrolResource#488
saivats wants to merge 2 commits into
openfoodfacts:developfrom
saivats:test/add-search-and-nutripatrol-tests

Conversation

@saivats

@saivats saivats commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds unit tests for two recently added features:

Tests added

TestProductSearch (4 tests)

  • Basic search with query param
  • Pagination (page + page_size)
  • sort_by parameter
  • .net environment URL

TestNutriPatrol (9 tests)

  • get_flag, get_flags, create_flag
  • get_flags_by_ticket_batch
  • get_ticket, get_tickets, get_tickets with filters
  • update_ticket_status (PUT)
  • get_stats, status

Result

32 total tests pass. ruff format and check clean.

@saivats

saivats commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

@raphael0202 — test coverage for the two methods you recently merged.
32 tests, all passing.

@raphael0202

raphael0202 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

edit: closed the wrong PR, sorry for this!

@raphael0202

Copy link
Copy Markdown
Contributor

@saivats Can you rebase your PR by including the latest changes in develop? I've merged the PR adding nutripatrol integration, which is slightly different than your original PR.

@saivats saivats force-pushed the test/add-search-and-nutripatrol-tests branch from b2b86a0 to 49dd815 Compare June 11, 2026 09:54
@sonarqubecloud

Copy link
Copy Markdown

@saivats

saivats commented Jun 11, 2026

Copy link
Copy Markdown
Contributor Author

@raphael0202 — rebased on upstream/develop. Updated all NutriPatrol
tests to use session_cookie auth to match the new check_auth_method()
requirement from #489. All 32 tests pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants