Пример #1
0
 def copy(self):
     local_fs = hdfs.hdfs("", 0)
     local_wd = utils.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)
     self.assertRaises(ValueError, local_fs.copy, "", self.fs, "")
     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 = utils.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)
     self.assertRaises(ValueError, local_fs.copy, "", self.fs, "")
     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 = utils.make_wd(self.fs)
Пример #4
0
 def setUp(self):
     self.fs = hdfs.hdfs(self.hdfs_host, self.hdfs_port)
     self.wd = utils.make_wd(self.fs)
Пример #5
0
 def setUp(self):
     self.fs = hdfs()
     self.wd = utils.make_wd(self.fs)
Пример #6
0
 def setUp(self):
     self.fs = hdfs()
     self.wd = utils.make_wd(self.fs)