test(gcp): add sync test for GCP iam in integration
Summary
Describe your changes.
I added a new test_sync() in test_iam.py that:
Creates the test project.
Loads roles and service accounts using the the tests
Asserts that the expected nodes and relationships are created
Related issues or links
Include links to relevant issues or other pages.
- https://github.com/cartography-cncf/cartography/issues/...
Checklist
Provide proof that this works (this makes reviews move faster). Please perform one or more of the following:
- [X] Update/add unit or integration tests.
- [ ] Include a screenshot showing what the graph looked like before and after your changes.
- [ ] Include console log trace showing what happened before and after your changes.
If you are changing a node or relationship:
If you are implementing a new intel module:
- [ ] Use the NodeSchema data model.
@jych Thanks for the feedback earlier.
I’ve updated the test so it now directly calls sync() and runs the full integration flow fetching roles and service accounts from our static test data, loading them into Neo4j, and performing cleanup. This covers both nodes and relationships in one pass, exercising the real code paths inside sync() rather than re-implementing them.
Thanks, I'll address all the points you raised and push the changes soon.
-
Added: Simple patches on the
get()functions using existing test data - Kept: All the assertion logic testing graph outcomes
-
Simplified:
iam_clientparameter can beNonesincegetfunctions are mocked
Hi @achantavy Sir, this time I have followed AGENTS.md guidelines for testing outcomes over implementation details.
Apologies for the previous commit.!!