Esempio n. 1
0
 def test_write_df(self):
     '''write_df() test'''
     df_dict = {'a':5, 'b':3, 'c':1}
     df_file = io.StringIO()
     freq_tools.write_df(df_dict, df_file)
     
     df_file.seek(0)
     self.assertEqual(freq_tools.read_df(df_file), df_dict)
Esempio n. 2
0
    def test_write_df(self):
        '''write_df() test'''
        df_dict = {'a': 5, 'b': 3, 'c': 1}
        df_file = io.StringIO()
        freq_tools.write_df(df_dict, df_file)

        df_file.seek(0)
        self.assertEqual(freq_tools.read_df(df_file), df_dict)
Esempio n. 3
0
 def test_read_df(self):
     '''read_df() test'''
     df_dict = {'a':5, 'b':3, 'c':1}
     df_file_str =\
     '''
     a    5
     b    3
     c    1
     '''
     df_file = io.StringIO(df_file_str)
     self.assertEqual(freq_tools.read_df(df_file), df_dict)
Esempio n. 4
0
 def test_read_df(self):
     '''read_df() test'''
     df_dict = {'a': 5, 'b': 3, 'c': 1}
     df_file_str =\
     '''
     a    5
     b    3
     c    1
     '''
     df_file = io.StringIO(df_file_str)
     self.assertEqual(freq_tools.read_df(df_file), df_dict)