Lower the string!

Report a typo

There is a function called string_to_lower(). We do not know its code, but we know exactly how it works — given a string, it converts it to lowercase. If the input is not a string, a ValueError exception is raised inside the function. You need to check that the code works correctly when the input is not a string.

In this Code Challenge, you do not need to import the module with the function in the beginning of the code. To call the function, just type its name, string_to_lower().

Write a program in Python 3
# tests for the string_to_lower() function
import unittest


class TestStringToLower(unittest.TestCase):
def test_string_to_lower(self):
# testing for an exception one way
self.assertRaises()

# testing for an exception another way
with self.assertRaises():

if __name__ == '__main__':
unittest.main()
___

Create a free account to access the full topic