@@ -218,6 +218,8 @@ class DataTest(unittest.TestCase):
218218
219219 df = pd .DataFrame (data = {'col1' : ['a' , 1 ,np .nan ,np .nan ], 'col2' : [1 , 'a' ,1 ,2.2 ]})
220220
221+ df_valid = pd .DataFrame (data = {'col1' : [2 , 1 ], 'col2' : [1 , 2 ]})
222+
221223 meta = [{"col1" :{"DataType" : "Int" ,"IsUnique" : "true" }},
222224 {"col2" :{"DataType" : "Int" ,"IsUnique" : "true" }}]
223225
@@ -259,6 +261,24 @@ def test_all_tests_for_column(self,df=df):
259261 test_column (df ['col1' ],{"DataType" : "Int" ,"IsUnique" : "true" })
260262 ,[{'DataType' : [[0 , 'a' ], [2 , 'nan' ], [3 , 'nan' ]]}, {'IsNull' : [[2 , 'nan' ], [3 , 'nan' ]]}])
261263
264+ def test_dataframe (self ):
265+ self .assertEqual (test_dataframe (self .df_valid , self .meta ),
266+ [])
267+
268+ def test_dataframe_too_few_meta (self ):
269+ # TODO: Charles can you confirm this behaviour is expected or should we improve test_data_frame?
270+ self .assertEqual (test_dataframe (self .df_valid , self .meta [:1 ]),
271+ [])
272+
273+ def test_dataframe_too_many_meta (self ):
274+ # TODO: Charles can you confirm this behaviour is expected or should we improve test_data_frame?
275+ self .assertEqual (test_dataframe (self .df_valid [['col1' ]], self .meta ),
276+ [])
277+
278+ def test_dataframe_incorrect_column_name (self ):
279+ # TODO: Charles can you confirm this behaviour is expected or should we improve test_data_frame?
280+ self .assertEqual (test_dataframe (self .df_valid .rename (columns = {'col1' : 'wrongname' }), self .meta ),
281+ [])
262282
263283 def test_all_tests_for_dataframe_with_errors (self , df = df , meta = meta ):
264284 self .assertEqual (
0 commit comments