I have been working on the create_spend_chart
method and everything seems to be working fine. All the spaces on the output seem to be exactly like what’s shown in the markdown file. The percentages are all aligned correctly. The category names are printed right below their bars. The horizontal line prints correctly too. However, the tests still say there’s something wrong with the string formatting. Any help from the community would be much appreciated, thank you!
Here is the one and only test error I get:
FAIL: test_create_spend_chart (test_module.UnitTests)
Traceback (most recent call last):
File “/home/runner/Budget-App/test_module.py”, line 94, in test_create_spend_chart
self.assertEqual(actual, expected, ‘Expected different chart representation. Check that all spacing is exact.’)
AssertionError: 'Perc[77 chars]| \n 60| \n 50| \n [297 chars] ’ != 'Perc[77 chars]| o \n 60| o \n 50| o \n [297 chars] t ’
Diff is 1309 characters long. Set self.maxDiff to None to see it. : Expected different chart representation. Check that all spacing is exact.
My code so far:
Here’s a link to my current code: https://replit.com/@ThunderClap/Budget-App#main.py
My browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36 Edg/93.0.961.47
Challenge: Budget App
Link to the challenge: