Ejemplo n.º 1
0
 def test_save(self):
     t = XArray([1, 2, 3])
     path = '{}/tmp/array-csv'.format(hdfs_prefix)
     t.save(path)
     success_path = os.path.join(path, '_SUCCESS')
     self.assertTrue(fileio.is_file(success_path))
     fileio.delete(path)
Ejemplo n.º 2
0
 def test_save_format(self):
     t = XArray([1, 2, 3])
     path = '{}/tmp/array-csv'.format(hdfs_prefix)
     t.save(path, format='csv')
     with fileio.open_file(path) as f:
         self.assertEqual('1', f.readline().strip())
         self.assertEqual('2', f.readline().strip())
         self.assertEqual('3', f.readline().strip())
     fileio.delete(path)