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

Tests are failing #364

Open
HomiGrotas opened this issue Feb 6, 2023 · 1 comment
Open

Tests are failing #364

HomiGrotas opened this issue Feb 6, 2023 · 1 comment

Comments

@HomiGrotas
Copy link

HomiGrotas commented Feb 6, 2023

I want to start contributing to this project but when I run tests some of them are failing, and some get errors.
Using version 0.19.0 with python3.10 and python2.7

When running tests on version 0.19.0 I get multiple failed tests:

  1. ERROR: test_clear_checklist (test.test_checklist.TrelloChecklistTestCase) /py-trello/trello/checklist.py", line 62, in clear old_items = items[:] NameError: name 'items' is not defined

  2. ERROR: test_delete_checklist_item (test.test_checklist.TrelloChecklistTestCase) py-trello/test/test_checklist.py", line 94, in test_delete_checklist_item self.assertEqual(len(checklists[0].items), 1) IndexError: list index out of range

  3. ERROR: test_add_delete_star (test.test_trello_client.TrelloClientTestCase) trello.exceptions.Unauthorized: unauthorized member permission requested. at https://api.trello.com/1/members/me/boardStars (HTTP status: 401)

  4. FAIL: test_checklist_rename (test.test_checklist.TrelloChecklistTestCase) /py-trello/test/test_checklist.py", line 82, in test_checklist_rename self.assertEqual(len(card.checklists), 1) AssertionError: 0 != 1

  5. FAIL: test_delete_checklist_remaining (test.test_checklist.TrelloChecklistTestCase) py-trello/test/test_checklist.py", line 68, in test_delete_checklist_remaining self.assertEqual(len(card.checklists), 1) AssertionError: 0 != 1

@ScottG489
Copy link

I'm doing some work on this and seeing failures as well. I believe the tests are just bad and this is likely no fault of your own.

I've just started looking into this, but I think the implementation is bad. test_delete_checklist_remaining for instance creates a card, adds two checklists to it, then deletes it. It then checks the card to assert there's 1 checklist on the card. However, the implementation logic for fetch_checklists has this at the top:

if self.countCheckLists == 0:
            return []

There are two problems with this:

  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.

Deleting that bit of code gets most of the tests to pass for me. And fixing another blatant syntax error fixes the one remaining failure.

I've created a PR (#371) to fix this.

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

No branches or pull requests

2 participants