示例#1
0
 def append(self):
     replication = 1  # see https://issues.apache.org/jira/browse/HDFS-3091
     content, update = utils.make_random_data(), utils.make_random_data()
     path = self._make_random_path()
     with self.fs.open_file(path, "w", replication=replication) as fo:
         fo.write(content)
     try:
         with utils.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 = utils.make_random_data(), utils.make_random_data()
     path = self._make_random_path()
     with self.fs.open_file(path, "w", replication=replication) as fo:
         fo.write(content)
     try:
         with utils.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
 def failUnlessRaisesExternal(self, excClass, callableObj, *args, **kwargs):
     utils.silent_call(self.failUnlessRaises, excClass, callableObj, *args, **kwargs)
示例#4
0
 def failUnlessRaisesExternal(self, excClass, callableObj, *args, **kwargs):
     utils.silent_call(self.failUnlessRaises, excClass, callableObj, *args,
                       **kwargs)