I have already witten a python code to convert json file to csv file in pycharm IDE like this:
import pandas as pd
import csv
df = pd.read_json(r"json file path")
df.to_csv(r"csv file path")
def read_data(data):
with open(data, "r") as f:
data = [row for row in csv.reader(f.read().splitlines())]
return data
data = "generatedcsvfilename.csv"
read_data(data)
Now I have to read the generated csv file to write unit testcases in python.
POSSIBLE TESTCASES:
To check if CSV file has been generated from json file in the specified folder.
To check if the file extension is .csv
To check if the CSV file is not empty.
Please help me to write unit testcases for the above listed testcases in python
Suggest me some more possible testcases if any.