本文整理汇总了Python中snakebite.client.Client.touchz方法的典型用法代码示例。如果您正苦于以下问题:Python Client.touchz方法的具体用法?Python Client.touchz怎么用?Python Client.touchz使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类snakebite.client.Client
的用法示例。
在下文中一共展示了Client.touchz方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: EffectiveUserTest
# 需要导入模块: from snakebite.client import Client [as 别名]
# 或者: from snakebite.client.Client import touchz [as 别名]
class EffectiveUserTest(MiniClusterTestBase):
ERR_MSG_TOUCH = "org.apache.hadoop.security.AccessControlException\nPermission denied: user=__foobar"
ERR_MSG_STAT = "`/foobar2': No such file or directory"
VALID_FILE = '/foobar'
INVALID_FILE = '/foobar2'
def setUp(self):
self.custom_client = Client(self.cluster.host, self.cluster.port)
self.custom_foobar_client = Client(host=self.cluster.host,
port=self.cluster.port,
effective_user='__foobar')
def test_touch(self):
print tuple(self.custom_client.touchz([self.VALID_FILE]))
try:
tuple(self.custom_foobar_client.touchz([self.INVALID_FILE]))
except Exception, e:
self.assertTrue(e.message.startswith(self.ERR_MSG_TOUCH))
self.custom_client.stat([self.VALID_FILE])
try:
self.custom_client.stat([self.INVALID_FILE])
except Exception, e:
self.assertEquals(e.message, self.ERR_MSG_STAT)
示例2: Client
# 需要导入模块: from snakebite.client import Client [as 别名]
# 或者: from snakebite.client.Client import touchz [as 别名]
from snakebite.client import Client
from constants import *
client = Client('localhost', NAMENODE_PORT)
# Create input.txt
print list(client.touchz(['/input/input.txt']))
# copy over input.txt
for f in client.copyToLocal(['/input/input.txt'], '/tmp'):
print f
# print text
for l in client.text(['/input/input.txt']):
print l