本文整理汇总了Python中SANSUtility.create_zero_error_free_workspace方法的典型用法代码示例。如果您正苦于以下问题:Python SANSUtility.create_zero_error_free_workspace方法的具体用法?Python SANSUtility.create_zero_error_free_workspace怎么用?Python SANSUtility.create_zero_error_free_workspace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SANSUtility
的用法示例。
在下文中一共展示了SANSUtility.create_zero_error_free_workspace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_that_non_existent_ws_creates_error_message
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import create_zero_error_free_workspace [as 别名]
def test_that_non_existent_ws_creates_error_message(self):
# Arrange
ws_name = 'original'
ws_clone_name = 'clone'
# Act
message, complete = su.create_zero_error_free_workspace(input_workspace_name = ws_name, output_workspace_name = ws_clone_name)
# Assert
message.strip()
self.assertTrue(message)
self.assertTrue(not complete)
示例2: test_that_bad_zero_error_removal_creates_error_message
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import create_zero_error_free_workspace [as 别名]
def test_that_bad_zero_error_removal_creates_error_message(self):
# Arrange
ws_name = 'original'
ws_clone_name = 'clone'
self._setup_workspace(ws_name, 'Event')
# Act
message, complete= su.create_zero_error_free_workspace(input_workspace_name = ws_name, output_workspace_name = ws_clone_name)
# Assert
message.strip()
self.assertTrue(message)
self.assertTrue(not ws_clone_name in mtd)
self.assertTrue(not complete)
self._removeWorkspace(ws_name)
self.assertTrue(not ws_name in mtd)
示例3: test_that_zeros_are_removed_correctly
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import create_zero_error_free_workspace [as 别名]
def test_that_zeros_are_removed_correctly(self):
# Arrange
ws_name = 'original'
ws_clone_name = 'clone'
self._setup_workspace(ws_name, 'Histogram')
# Act
message, complete = su.create_zero_error_free_workspace(input_workspace_name = ws_name, output_workspace_name = ws_clone_name)
# Assert
message.strip()
print message
# self.assertTrue(not message)
#self.assertTrue(complete)
self.assertTrue(mtd[ws_name] != mtd[ws_clone_name])
self._removeWorkspace(ws_name)
self._removeWorkspace(ws_clone_name)
self.assertTrue(not ws_name in mtd)
self.assertTrue(not ws_clone_name in mtd)
示例4: get_mapped_workspaces
# 需要导入模块: import SANSUtility [as 别名]
# 或者: from SANSUtility import create_zero_error_free_workspace [as 别名]
def get_mapped_workspaces(save_names, save_as_zero_error_free):
"""
Get a workspace name map, which maps from the original
workspace to a zero-error-free cloned workspace if
save_as_zero_error_free is checked otherwise the
workspaces are mapped to themselves.
@param save_names: a list of workspace names
@param save_as_zero_error_free : if the user wants the zero-errors removed
@returns a map of workspaces
"""
workspace_dictionary = {}
for name in save_names:
if save_as_zero_error_free:
cloned_name = name + '_cloned_temp'
dummy_message, complete = su.create_zero_error_free_workspace(input_workspace_name = name, output_workspace_name = cloned_name)
if complete:
workspace_dictionary[name] = cloned_name
else:
workspace_dictionary[name] = name
else:
workspace_dictionary[name] = name
return workspace_dictionary