MRU-COMP1701-dev / fopp-functions-first

Foundations of Python Programming: Functions First
GNU Free Documentation License v1.3
0 stars 3 forks source link

Check unit tests #8

Open cfcurtis opened 1 year ago

cfcurtis commented 1 year ago

Some unit tests seem to be missing indentation. For example, I've fixed the ones in Fuctions, but it's something to look out for.

Indentation should be as follows:

=====

from unittest.gui import TestCaseGui

class myTests(TestCaseGui):
    def testOne(self):
        self.assertEqual(same_thing(5), 5,"Testing the function same_thing with input 5")
        self.assertEqual(same_thing("Welcome"), "Welcome", "Testing the function same_thing with input 'Welcome'")

myTests().main()

Similarly, there are some hard line wraps that I suspect will also cause syntax errors.

cfcurtis commented 1 year ago

Another unit test issue, for example in ac12_04_5 of the Chapter Assessment in Exceptions: correcting the code and running the unit test results in Error: InvalidCharacterError: Failed to execute 'add' on 'DOMTokenList': The token provided ('btn btn-info') contains HTML space characters, which are not valid in tokens.

Things tried:

It seems as though there's a specific character(s) that it doesn't like in the list, but I haven't figured out which one it is.

cfcurtis commented 1 year ago

Still some remaining, reported here.