Question: Tasks: 1 . Complete Task 1 : Develop Unit Tests for Load Data Module. 2 . Complete Task 2 : Complete the test _ load
Tasks:
Complete Task : Develop Unit Tests for Load Data Module.
Complete Task : Complete the testloaddata Module.
Task : Develop Unit Tests for Load Data Module
As a team, you will write four different test cases for your loaddata module. Remember to use
automated testing, as you learned during the lectures. You need to import the check module
explained during the lectures. Use the functions in the check module in your implementation.
You are not allowed to modify the check module.
Docstring and type annotations are not required for this lab.
For your tests, use the characterstest.csv file provided.
STEP
Read the descriptions of the tests below.
Decide who is writing which test.
Test : Functions Return a List
In a file named testpy write a test function named testreturnlist to test that all six functions in
the load data module return a list.
For each function except loaddata you need to provide at least test cases:
functions testfunction test cases
For function loaddata, you need to provide test cases.
Thats test cases in total.
The function is the folowing:
def characteroccupationlistfile: str occupation: str:
occupationls
targetfile openfiler
firstline True
for line in targetfile:
person
line line.strip
split
if firstline:
firstline False
header line
else:
if occupation in line:
for i in range lenheader:
if i :
personheaderi floatlinei
elif i :
personheaderi strlinei
else:
personheaderi intlinei
occupationlsappendperson
targetfile.close
return occupationls
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
