-
Notifications
You must be signed in to change notification settings - Fork 328
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
Fix checklist tests #371
Open
ScottG489
wants to merge
23
commits into
sarumont:master
Choose a base branch
from
ScottG489:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix checklist tests #371
Conversation
This file contains 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
We want to delete all checklist items on the current instance.
There are two problems with trying to do this check to prevent an actual fetch from happening: 1. `self.countChecklists` is only written to in `from_json` when the card is created 2. If the backing card is modified externally while the card object lives in memory, it will have no way of knowing a list was added. Point 1 could be fixed, but 2 could not since there's no way of knowing if the card has been updated externally.
This simplifies setup for the test and ensures it manages it's own test resources.
This simplifies setup for the tests and ensures they manage their own test resources.
This simplifies setup for the tests since they don't rely on the external dependency of a test board being created by the user. They now manage their own dependencies. - Remove test_list_stars because this functionality is already tested in another test.
- Make note that a test Trello account should be used for testing.
FYI you can ignore all commits other than the first two in this PR. I'm doing some other work that may come in a different PR, but forgot to open a separate branch in my fork. |
This makes the test more self contained so they're easier to reason about.
When requesting resources you can specify only certain fields on those resources are returned. This can be as minimal as only the IDs. This means that when parsing json into resources, we can't assume any field other than the id will be present. All other model resources should also be updated, but only doing List and Board for now.
The batch endpoint allows you to specify multiple requests at once and get a list of responses. This greatly increases performance and can be critical to avoiding Trello rate limiting. This is an incomplete implemetation that only adds support for two Board endpoints.
Similar to recent changes to Board and List. The API can return minimal representations of these with only supplying the ID, so that's all we'll require to create an instance from the from_json method.
The list of cards can now be guaranteed to be accessible on a trello list object.
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.
The tests were good, but there were actual bugs in the code causing the tests to fail which have been fixed. One was just a syntax error and the other was an attempted optimization that I don't think is feasible.
We were attempting to prevent fetching checklists when none existed on the card. However, there are two problems with trying to do this check to prevent an actual fetch from happening:
self.countChecklists
is only written to infrom_json
when thecard is created
lives in memory, it will have no way of knowing a list was added.
Point 1 could be fixed, but 2 could not since there's no way of knowing if the card has been updated externally.