Making pytest unit test program applicable to multiple files

Viewed 29

I'm currently writing a unit test program for a data converter that converts JSON data to pandas data frames. I didn't write the converter program, so I'm unsure how to make assertions and compare the JSON data sample I have to the converted data frames. So far, I have:

def test_headerdftrue_S():
    f = open("sample_jsondata")
    var_a, var_b, var_c, var_d = je.json_to_df("sample_jsondata")

    # Runs function json_to_df with sample given json data
    # Checks var_a id value with expected value
    assert header["id"][10] == 85408

je is the given converter script; instead of comparing the data frame value to a number, I would like to compare it to its corresponding value in the original JSON file. Does anyone know how I could do this?

0 Answers
Related