Skip to content

Commit

Permalink
tests: replace use of deprecated assertEquals with assertEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
brutasse committed Jun 3, 2016
1 parent c566142 commit a4c2fa0
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions test/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def _add_checklist(self, card, name, items=[], itemstates=None):
checklist = card.add_checklist(name, items, itemstates)
self.assertIsNotNone(checklist, msg="checklist is None")
self.assertIsNotNone(checklist.id, msg="id not provided")
self.assertEquals(checklist.name, name)
self.assertEqual(checklist.name, name)
return checklist

def test_get_cards(self):
Expand All @@ -53,8 +53,8 @@ def test_get_cards(self):
for i in range(nb_cards):
self._add_card(names[i])
cards = self._board.get_cards()
self.assertEquals(len(cards), nb_cards)
self.assertEquals(len(cards), len(self._board.open_cards()))
self.assertEqual(len(cards), nb_cards)
self.assertEqual(len(cards), len(self._board.open_cards()))

for card in cards:
self.assertTrue(card.name in names, 'Unexpected card found')
Expand Down Expand Up @@ -88,7 +88,7 @@ def test_delete_cards(self):
for card in cards:
card.delete()
self._board.fetch_actions(action_filter='all', action_limit=nb_open_cards)
self.assertEquals(len(self._board.actions), nb_open_cards)
self.assertEqual(len(self._board.actions), nb_open_cards)
for action in self._board.actions:
self.assertEqual(action['type'], 'deleteCard')

Expand All @@ -101,7 +101,7 @@ def test_close_cards(self):
card.set_closed(True)
cards_after = self._board.closed_cards()
nb_cards_after = len(cards_after)
self.assertEquals(nb_cards_after, nb_closed_cards + nb_open_cards)
self.assertEqual(nb_cards_after, nb_closed_cards + nb_open_cards)


def test_all_cards_reachable(self):
Expand Down
24 changes: 12 additions & 12 deletions test/test_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _add_card(self, name, description=None):
card = self._list.add_card(name, description)
self.assertIsNotNone(card, msg="card is None")
self.assertIsNotNone(card.id, msg="id not provided")
self.assertEquals(card.name, name)
self.assertEqual(card.name, name)
return card
except Exception as e:
print(str(e))
Expand All @@ -44,15 +44,15 @@ def test40_add_card(self):
self.assertFalse(card.closed, msg="Card should not be closed")

card2 = self._trello.get_card(card.id)
self.assertEquals(card.name, card2.name)
self.assertEqual(card.name, card2.name)

def test41_add_card_desc(self):
name = "Testing from Python"
description = "Description goes here"
card = self._add_card(name, description)

card.fetch()
self.assertEquals(description, card.description)
self.assertEqual(description, card.description)
self.assertIsNotNone(card.url, msg="url not provided")
self.assertIsNotNone(card.member_id)
self.assertIsNotNone(card.short_id)
Expand All @@ -68,25 +68,25 @@ def test42_add_card_with_comments_fetch(self):
card.comment(comment)
card.fetch(True)

self.assertEquals(len(card.comments), 1)
self.assertEquals(card.comments[0]['data']['text'], comment)
self.assertEqual(len(card.comments), 1)
self.assertEqual(card.comments[0]['data']['text'], comment)

def test43_get_comments(self):
name = "Card with comments 2"
comment = "Hello World!"
card = self._add_card(name)
card.comment(comment)
card._comments = card.get_comments()
self.assertEquals(len(card.comments), 1)
self.assertEquals(card.comments[0]['data']['text'], comment)
self.assertEqual(len(card.comments), 1)
self.assertEqual(card.comments[0]['data']['text'], comment)

def test44_attach_url_to_card(self):
name = "Testing from Python - url"
card = self._add_card(name)

card.attach(name='lwn', url='http://lwn.net/')
card.fetch()
self.assertEquals(card.badges['attachments'], 1)
self.assertEqual(card.badges['attachments'], 1)
card.delete()

def test52_add_card_set_due(self):
Expand All @@ -102,21 +102,21 @@ def test52_add_card_set_due(self):
# Refresh the due date from cloud
card.fetch()
actual_due_date = card.due
self.assertEquals(expected_due_date[:8], actual_due_date[:8])
self.assertEqual(expected_due_date[:8], actual_due_date[:8])

def test_set_name(self):
name = "Testing set card name"
card = self._list.add_card('noname')
card.set_name(name)
self.assertEquals(card.name, name)
self.assertEqual(card.name, name)

def test_set_desc(self):
card = self._list.add_card("Testing set card desc")
description = "Description goes here"
card.set_description(description)
self.assertEquals(card.description, description)
self.assertEqual(card.description, description)
card.fetch()
self.assertEquals(card.description, description)
self.assertEqual(card.description, description)

def test_set_closed(self):
name = "Testing set card closed"
Expand Down
6 changes: 3 additions & 3 deletions test/test_checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _add_card(self, name, description=None):
card = self._list.add_card(name, description)
self.assertIsNotNone(card, msg="card is None")
self.assertIsNotNone(card.id, msg="id not provided")
self.assertEquals(card.name, name)
self.assertEqual(card.name, name)
return card
except Exception as e:
print(str(e))
Expand All @@ -40,7 +40,7 @@ def _add_checklist(self, card, name, items=[]):
checklist = card.add_checklist(name, items)
self.assertIsNotNone(checklist, msg="checklist is None")
self.assertIsNotNone(checklist.id, msg="id not provided")
self.assertEquals(checklist.name, name)
self.assertEqual(checklist.name, name)
return checklist

def test_delete_checklist(self):
Expand Down Expand Up @@ -76,7 +76,7 @@ def test_checklist_rename(self):
new_name = "Renamed"
checklist = self._add_checklist(card, name, ['item1', 'item2'])
checklist.rename(new_name)
self.assertEquals(checklist.name, new_name)
self.assertEqual(checklist.name, new_name)
card._checklists = card.fetch_checklists()
self.assertEqual(len(card.checklists), 1)
self.assertEqual(card.checklists[0].name, new_name)
Expand Down
2 changes: 1 addition & 1 deletion test/test_trello_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def setUp(self):
token=os.environ['TRELLO_TOKEN'])

def test01_list_boards(self):
self.assertEquals(
self.assertEqual(
len(self._trello.list_boards(board_filter="open")),
int(os.environ['TRELLO_TEST_BOARD_COUNT']))

Expand Down

0 comments on commit a4c2fa0

Please sign in to comment.