Package: tresto
TrestoTresto is a Python library that integrates with Trello to provide advanced
functionality for unit testing.  With Tresto, you can create Trello cards
for each test automatically, and these cards will be moved to the
appropriate list based on the test results.  This makes Tresto an ideal tool
for test-driven development, as it provides a convenient and visual way to
monitor the progress of your tests.InstallationYou can install Tresto using pip:pip3installtrestoUsageUsing Tresto is easy.  Simply create a TrestoTestCase and write your tests
as you normally would.  However, you will need to set up your Trello API key
and token as environment variables TRELLO_API_KEY and TRELLO_API_TOKEN.importunittestfromtrestoimportTrestoTestCase# FIX: arithmetic.py is in examples/ folderfromarithmeticimportadd,subtract,multiply,divideclassTestArithmetic(TrestoTestCase):auto_create_board=Trueauto_create_lists=Truedeftest_add(self):self.assertEqual(add(1,2),3)deftest_subtract(self):self.assertEqual(subtract(5,3),2)deftest_multiply(self):self.assertEqual(multiply(2,3),6)deftest_divide(self):self.assertEqual(divide(6,3),2)deftest_divide_by_zero(self):withself.assertRaises(ValueError):divide(1,0)if__name__=='__main__':unittest.main()You can then run your tests using the standard Python unittest framework.
See the tests/ subdirectory for test_hello_world.py, test_arithmetic.py and test_tresto.py -
Yes, that's Tresto testing itself:importosimportunittestfromtrestoimportTrestoTestCasefromtrello.exceptionsimportResourceUnavailableclassTestTresto(TrestoTestCase):defsetUp(self):self.card_failed=Noneself.card_passed=Nonedeftest_1_board_setup(self):self.assertIsNotNone(self.board)self.assertEqual(self.board.name,self.board_name)deftest_2_list_setup(self):self.assertIsNotNone(self.passed_list)self.assertIsNotNone(self.failed_list)self.assertEqual(self.passed_list.name,self.test_passed_list)self.assertEqual(self.failed_list.name,self.test_failed_list)deftest_3_add_and_delete_cards(self):# Test add_card and delete_card for FAILED Listcard_name_failed="Test Card for FAILED List"self.card_failed=self.add_card(self.failed_list,card_name_failed)self.assertEqual(self.card_failed.name,card_name_failed,self.failed_list)self.card_failed.delete()try:deleted_card_failed=self.board.get_card(self.card_failed.id)self.fail("Card was not deleted")exceptResourceUnavailable:pass# Test add_card and delete_card for PASSED Listcard_name_passed="Test Card for PASSED List"self.card_passed=self.add_card(self.passed_list,card_name_passed)self.assertEqual(self.card_passed.name,card_name_passed,self.passed_list)self.card_passed.delete()try:deleted_card_passed=self.board.get_card(self.card_passed.id)self.fail("Card was not deleted")exceptResourceUnavailable:passdeftest_4_add_and_move_card_between_lists(self):card_name="Test Card for Moving Between Lists"card=self.add_card(self.passed_list,card_name)self.move_card(card,self.failed_list)# Refresh card datacard.fetch()self.assertEqual(card.list_id,self.failed_list.id,self.failed_list)card.delete()if__name__=='__main__':unittest.main()AcknowledgementsTresto is built using thepy-trellolibrary. Thank you to the py-trello developers for their great work!ContributingContributions are always welcome!  If you find a bug or have a suggestion
for how to improve Tresto, please open an issuehere.