fix: migrate example plugin test from cmempy to cmem-client - #53
Open
msaipraneeth wants to merge 2 commits into
Open
fix: migrate example plugin test from cmempy to cmem-client#53msaipraneeth wants to merge 2 commits into
msaipraneeth wants to merge 2 commits into
Conversation
The generated example test imported cmem.cmempy directly. cmem-plugin-base is dropping its cmem-cmempy dependency in favor of cmem-client, and this template never declared cmem-cmempy itself, so every newly generated plugin project (and this template's own CI, which generates and checks a project) would break with ModuleNotFoundError once the new cmem-plugin-base ships. Switches the example fixture and test to cmem-client directly, matching the pattern cmem-plugin-base's own test suite now uses, and makes the test project idempotent (delete-then-create) so a crashed prior run doesn't break the next one.
client.datasets.get_file_resource() returns a streaming httpx.Response; .text can't be accessed before .read(), same as ProjectFile.read_stream handles it in cmem-plugin-base. Caught by generating a project from this template and running its tests against a real CMEM instance.
Coverage Report
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmem.cmempydirectly.cmem-plugin-baseis dropping itscmem-cmempydependency in favor ofcmem-client, and this template never declaredcmem-cmempyitself, so newly generated plugin projects (and this template's own CI, which generates and checks a project) would break withModuleNotFoundErroronce the newcmem-plugin-baseships.cmem-clientdirectly (added as a dev dependency), matching the patterncmem-plugin-base's own test suite now uses, and makes the fixture idempotent (delete-then-create) so a crashed prior run doesn't break the next one.client.datasets.get_file_resource()returns a streaminghttpx.Response, so.textneeds.read()first.Test plan
copier copy --defaults . plugin_dirusing theplugin.ymltest casepoetry install,mypy,ruff check,ruff format --checkall clean on the generated projectpytestpassed against a real CMEM instance (plugin-testing.eccenca.dev), including bothneeds_cmem-gated integration testspytesta second consecutive time to confirm the delete-then-create fixture is idempotent against leftover state