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)
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)
def failUnlessRaisesExternal(self, excClass, callableObj, *args, **kwargs): silent_call(self.failUnlessRaises, excClass, callableObj, *args, **kwargs)