Exemplo 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)
Exemplo 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)
Exemplo 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)
Exemplo 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)