Пример #1
0
 def test_no_cards(self):
     """
     Test: Call create_calendar_from_cards with empty card list.
     Expected result: Empty calendar will be created.
     """
     #Create a feed with only one of the boards:
     cal = logic.create_calendar_from_cards([], self.feed)
     
     self.assertEqual(cal.subcomponents, [])
Пример #2
0
 def test_with_cards(self):
     """
     Test: Call create_calendar_from_cards with cards.
     Expected result: Calendar with subcomponents will be created.
     """
     #Create a feed with only one of the boards:
     client = trello.client.Trello(API_KEY, self.user.user_token)
     boards = client.list_boards()
     
     test_boards = [board for board in boards if board.id in TEST_BOARDS]
     card_list = []
     for b in test_boards:
         card_list += b.list_cards()
     
     card_list = [c for c in card_list if c.due]
 
     cal = logic.create_calendar_from_cards(card_list, self.feed)
     
     self.assertEqual(len(cal.subcomponents), 4)