I can’t find the difference between the unit test test_create_spend_chart and my implementation of it.
#-##-##-##-##-# Unit Test #-##-##-##-##-#
Percentage spent by category
100|
90|
80|
70| o
60| o
50| o
40| o
30| o
20| o o
10| o o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
#-##-##-##-##-# End Unit Test #-##-##-##-##-#
#-##-##-##-##-# My Implementation #-##-##-##-##-#
Percentage spent by category
100|
90|
80|
70| o
60| o
50| o
40| o
30| o
20| o o
10| o o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
#-##-##-##-##-# End My Implementation #-##-##-##-##-#
#-##-##-##-##-# Unit Test #-##-##-##-##-#
Percentage spent by category
100|
90|
80|
70| o
60| o
50| o
40| o
30| o
20| o o
10| o o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
#-##-##-##-##-# End Unit Test #-##-##-##-##-#
#-##-##-##-##-# My Implementation #-##-##-##-##-#
Percentage spent by category
100|
90|
80|
70| o
60| o
50| o
40| o
30| o
20| o o
10| o o
0| o o o
----------
B F E
u o n
s o t
i d e
n r
e t
s a
s i
n
m
e
n
t
#-##-##-##-##-# End My Implementation #-##-##-##-##-#
It would help if you provided a link to your code and the actual diff provided by the test suite, but it looks like you have the wrong number of spaces at the end of each line.
======================================================================
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[34 chars] \n 90| \n 80| \n 70| o[315 chars] t' != 'Perc[34 chars] \n 90| \n 80| \n 70| [340 chars] t '
Diff is 1246 characters long. Set self.maxDiff to None to see it. : Expected different chart representation. Check that all spacing is exact.
----------------------------------------------------------------------
Ran 11 tests in 0.009s
FAILED (failures=1)
All right, thanks for the help.
Do you know of a way to contact the freeCodeCamp staff? I would like to prevent this issue in the future for other people.
It’s part of the spec for the problem. If we diff your string and the output, we have to have character for character agreement. I don’t know how we could easily check for an arbitrary number of spaces after each line.
I think they tried to warn about this in the test suite: