Esempio n. 1
0
    def test_use_case_yaml_yaml(self):
        """Simple use case using core tools for reading,
        computing and writing"""
        raised = False

        try:
            data = dr.DataReader(data=data_paths['yaml'],
                                 f_format='yaml').read()
            table = st.StashTable(data=data, table='data')
            table.save()

            subset = table.get(key='gender',
                               value='Female',
                               operator='==',
                               reindex=True)

            dw.write_yaml(data=subset, file='subset.yaml')

            table.un_stash()

            os.remove('subset.yaml')
        except:
            raised = True

        self.assertIs(raised, False)
Esempio n. 2
0
 def test_write_yaml(self):
     """Write to yaml"""
     data = dr.DataReader(f_format='csv',
                          data=cwd + '/test/data/basic_csv.csv') \
         .read(delim=',')
     dw.write_yaml(data=data, file='tmp.yaml')
     self.assertIs(os.path.isfile('tmp.yaml'), True)
     os.remove('tmp.yaml')