本文整理汇总了Python中dirigible.sheet.worksheet.Worksheet.clear_values方法的典型用法代码示例。如果您正苦于以下问题:Python Worksheet.clear_values方法的具体用法?Python Worksheet.clear_values怎么用?Python Worksheet.clear_values使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dirigible.sheet.worksheet.Worksheet
的用法示例。
在下文中一共展示了Worksheet.clear_values方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_clear_values_deletes_cells_with_empty_formula
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import clear_values [as 别名]
def test_clear_values_deletes_cells_with_empty_formula(self):
ws = Worksheet()
ws[1, 2].formula = ''
ws[1, 2].value = "hello!"
ws[1, 2].formatted_value = "Guten Tag!"
ws.clear_values()
self.assertFalse((1, 2) in ws)
示例2: test_clear_values_clears_values_and_formatted_values_and_errors
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import clear_values [as 别名]
def test_clear_values_clears_values_and_formatted_values_and_errors(self):
ws = Worksheet()
ws[1, 2].formula = "=1"
ws[1, 2].python_formula = "2"
ws[1, 2].value = "hello!"
ws[1, 2].formatted_value = "Guten Tag!"
ws[1, 2].error = "Goodness Gracious!"
ws[2, 2].python_formula = "1 + 1"
ws.clear_values()
self.assertEquals(ws[1, 2].formula, "=1")
self.assertEquals(ws[1, 2].python_formula, "2")
self.assertEquals(ws[1, 2].value, undefined)
self.assertEquals(ws[1, 2].formatted_value, u'')
self.assertEquals(ws[1, 2].error, None)
self.assertEquals(ws[2, 2].python_formula, '1 + 1')
示例3: test_calculate_clears_previous_worksheet_cell_values_before_executing_usercode
# 需要导入模块: from dirigible.sheet.worksheet import Worksheet [as 别名]
# 或者: from dirigible.sheet.worksheet.Worksheet import clear_values [as 别名]
def test_calculate_clears_previous_worksheet_cell_values_before_executing_usercode(
self, mock_execute_usercode
):
calls_list = []
worksheet = Worksheet()
worksheet.clear_values = Mock()
worksheet.clear_values.side_effect = lambda *args : calls_list.append('clear values')
mock_execute_usercode.side_effect = lambda *args : calls_list.append('execute usercode')
calculate(worksheet, sentinel.usercode, sentinel.private_key)
self.assertEquals(calls_list, ['clear values', 'execute usercode'])