本文整理汇总了Python中seishub.core.processor.Processor.path方法的典型用法代码示例。如果您正苦于以下问题:Python Processor.path方法的具体用法?Python Processor.path怎么用?Python Processor.path使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类seishub.core.processor.Processor
的用法示例。
在下文中一共展示了Processor.path方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_processResourceType
# 需要导入模块: from seishub.core.processor import Processor [as 别名]
# 或者: from seishub.core.processor.Processor import path [as 别名]
def test_processResourceType(self):
proc = Processor(self.env)
proc.path = '/xml/processor-test/notvc'
# test valid GET method
data = proc.run(GET, '/xml/processor-test/notvc')
# data must be a dict
self.assertTrue(isinstance(data, dict))
# test valid POST method
data = proc.run(POST, '/xml/processor-test/notvc', StringIO(XML_DOC))
# check response; data should be empty; we look into request
self.assertFalse(data)
self.assertEqual(proc.code, http.CREATED)
self.assertTrue(isinstance(proc.headers, dict))
self.assertTrue('Location' in proc.headers)
location = proc.headers.get('Location')
self.assertTrue(location.startswith(self.env.getRestUrl() + proc.path))
# strip REST url from location
location = location[len(self.env.getRestUrl()):]
# fetch resource and compare it with original
data = proc.run(GET, location)
self.assertTrue(data, XML_DOC)
# delete uploaded resource
data = proc.run(DELETE, location)
# check response; data should be empty; we look into request
self.assertFalse(data)
self.assertEqual(proc.code, http.NO_CONTENT)