TU856/858-2 Object Oriented Programming with Python Semester 1, Lab Week 11, 04.12.2020 Dr. Bianca Schoen-Phelan Please join the virtual classroom in brightspace first, before going to individual lab links. I will provide explanations and hints and tricks regarding the lab at the beginning of the lab sessions. These are recorded. Please sign your group’s lab sign in sheet! Lab solutions will be discussed in the Monday lecture. Labs are not marked. Don’t forget about your revision item for the week! Link to the lab groups (click). Link to python documentation (click). Link to python documentation on unittest (click). Objectives: ● Practice python unittesting ● Importing your own modules Please update your github to fetch the lab file. Your task: ● Plan tests for the methods in python_testing.py ○ Example set up for a testing spreadsheet here (copy file or make your own) ● Create a new Python file in your work directory where your tests are going to happen ○ Import unittest and the python_testing content ● Write all tests necessary to check the correct outcome of the methods ○ Hint: One method has a deliberate mistake ○ Make sure you check that errors are thrown for wrong input types ○ You must use a setUp() method ○ Use decorators where appropriate Advanced: ● Start with the most recent lab and write a test plan and test cases for this lab ● Go backwards through the labs (exclude the card game for now, the Python documentation linked above has some hints on how to test GUI, so feel free to go for it after reading the material) and practice testing Well done! Page 1 of 1
欢迎咨询51作业君