예제 #1
0
 def copy(self):
   local_fs = hdfs.hdfs('', 0)
   local_wd = make_wd(local_fs)
   from_path = os.path.join(local_wd, uuid.uuid4().hex)
   content = uuid.uuid4().hex
   with open(from_path, "w") as f:
     f.write(content)
   to_path = self._make_random_file()
   local_fs.copy(from_path, self.fs, to_path)
   local_fs.close()
   with self.fs.open_file(to_path) as f:
     self.assertEqual(f.read(), content)
   shutil.rmtree(local_wd)
예제 #2
0
 def copy(self):
     local_fs = hdfs.hdfs('', 0)
     local_wd = make_wd(local_fs)
     from_path = os.path.join(local_wd, uuid.uuid4().hex)
     content = uuid.uuid4().hex
     with open(from_path, "w") as f:
         f.write(content)
     to_path = self._make_random_file()
     local_fs.copy(from_path, self.fs, to_path)
     local_fs.close()
     with self.fs.open_file(to_path) as f:
         self.assertEqual(f.read(), content)
     shutil.rmtree(local_wd)
예제 #3
0
 def setUp(self):
   self.fs = hdfs.hdfs(self.hdfs_host, self.hdfs_port)
   self.wd = make_wd(self.fs)
예제 #4
0
 def setUp(self):
     self.fs = hdfs.hdfs(self.hdfs_host, self.hdfs_port)
     self.wd = make_wd(self.fs)