Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/SK-1289 | Added test for store list functionality #808

Merged
merged 4 commits into from
Feb 10, 2025

Conversation

carl-andersson
Copy link
Contributor

This pull request includes various changes to improve the testing setup, database connection handling. The most important changes include adding new VS Code configurations for testing, updating database connection methods.

…ests failed. Also added helpers to setup the tests using pip install docker
@github-actions github-actions bot added minor feature New feature or request and removed minor labels Feb 6, 2025
@carl-andersson carl-andersson changed the title Feature/SK-1289 | Added test for store.list Feature/SK-1289 | Added test for store list functionality Feb 6, 2025
@carl-andersson carl-andersson changed the title Feature/SK-1289 | Added test for store list functionality Feature/SK-1289 | Added test for store list functionality Feb 6, 2025
@github-actions github-actions bot added the minor label Feb 7, 2025
receiver_role=receiver.get("role"),
sender_name=sender.get("name"),
sender_role=sender.get("role"),
receiver_name=receiver.get("name") if receiver else None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The get method returns None if not present no? At least I think you can set a default: get("name", None)... But I might be misstaken...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If reciever is None you can't call .get() on it. That's the problem

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahh yeah, my misstake

@@ -238,8 +238,10 @@ def list(self, limit: int, skip: int, sort_key: str, sort_order=pymongo.DESCENDI

stmt = stmt.order_by(sort_obj)

if limit != 0:
if limit:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could perhaps check so that these values are positive... (This and similar)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it might be a good idea. For now I was happy with just supporting the current usage. It seemed that both None and 0 was used interchangably there so I figure that the code should support that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This too is due to how the stores have been used (only via the routes). Previously we have programatically ensured limit will never be null... This is an improvement as is, do with the comment what you will.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet but can this not be done with a class based approach? Similar to how we have the store set up I imagine... The stores should work similar across different entities so there should be some common ground. It's a thought but I think I could help when adding when adding tests for updating, deleting etc...

@carl-andersson carl-andersson merged commit 2058d71 into master Feb 10, 2025
17 checks passed
@carl-andersson carl-andersson deleted the feature/SK-1289 branch February 10, 2025 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request minor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants