Esempio n. 1
0
 def test_missing_cols(self):
     df = pd.read_csv(bad_input["missing_cols"])
     with pytest.raises(KeyError):
         preprocess(df, "state")
Esempio n. 2
0
 def test_invalid_fips(self):
     df = pd.read_csv(bad_input["invalid_fips"])
     with pytest.raises(AssertionError):
         preprocess(df, "county")
Esempio n. 3
0
 def test_preprocess_no_data(self):
     output = preprocess(pd.DataFrame(columns=keep_cols), "state")
     expected = pd.DataFrame(columns=new_keep_cols)
     assert output.equals(expected)