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

Fix checklist tests #371

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Fix checklist tests #371

wants to merge 23 commits into from

Conversation

ScottG489
Copy link

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:

  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.

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.
@ScottG489 ScottG489 mentioned this pull request Nov 14, 2023
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.
@ScottG489
Copy link
Author

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.

ScottG489 and others added 17 commits November 22, 2023 12:15
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant