コード例 #1
0
ファイル: common_hdfs_tests.py プロジェクト: kmatzen/pydoop
 def append(self):
   replication = 1  # see https://issues.apache.org/jira/browse/HDFS-3091
   content, update = make_random_data(), make_random_data()
   path = self._make_random_path()
   with self.fs.open_file(path, "w", replication=replication) as fo:
     fo.write(content)
   try:
     with silent_call(self.fs.open_file, path, "a") as fo:
       fo.write(update)
   except IOError:
     sys.stderr.write("NOT SUPPORTED ... ")
     return
   else:
     with self.fs.open_file(path) as fi:
       self.assertEqual(fi.read(), content+update)
コード例 #2
0
 def append(self):
     replication = 1  # see https://issues.apache.org/jira/browse/HDFS-3091
     content, update = make_random_data(), make_random_data()
     path = self._make_random_path()
     with self.fs.open_file(path, "w", replication=replication) as fo:
         fo.write(content)
     try:
         with silent_call(self.fs.open_file, path, "a") as fo:
             fo.write(update)
     except IOError:
         sys.stderr.write("NOT SUPPORTED ... ")
         return
     else:
         with self.fs.open_file(path) as fi:
             self.assertEqual(fi.read(), content + update)
コード例 #3
0
ファイル: common_hdfs_tests.py プロジェクト: kmatzen/pydoop
 def failUnlessRaisesExternal(self, excClass, callableObj, *args, **kwargs):
   silent_call(self.failUnlessRaises, excClass, callableObj, *args, **kwargs)
コード例 #4
0
 def failUnlessRaisesExternal(self, excClass, callableObj, *args, **kwargs):
     silent_call(self.failUnlessRaises, excClass, callableObj, *args,
                 **kwargs)