本文整理汇总了Python中vis.workflow.WorkflowManager._make_table方法的典型用法代码示例。如果您正苦于以下问题:Python WorkflowManager._make_table方法的具体用法?Python WorkflowManager._make_table怎么用?Python WorkflowManager._make_table使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vis.workflow.WorkflowManager
的用法示例。
在下文中一共展示了WorkflowManager._make_table方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_table_3
# 需要导入模块: from vis.workflow import WorkflowManager [as 别名]
# 或者: from vis.workflow.WorkflowManager import _make_table [as 别名]
def test_table_3(self):
'''
_make_table():
- "count frequency" is False
- file extension not on "pathname"
- there are several IndexedPiece objects
'''
test_wm = WorkflowManager([])
test_wm.settings(None, 'count frequency', False)
test_wm._result = [mock.MagicMock(spec_set=pandas.DataFrame) for _ in range(5)]
test_wm._data = ['boop' for _ in range(len(test_wm._result))]
top_x = None
threshold = None
pathname = 'test_path'
test_wm._make_table('CSV', pathname, top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('Excel', pathname, top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('Stata', pathname, top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('HTML', pathname, top_x, threshold) # pylint: disable=protected-access
for i in range(len(test_wm._result)):
test_wm._result[i].to_csv.assert_called_once_with('{}-{}{}'.format(pathname, i, '.csv'))
test_wm._result[i].to_excel.assert_called_once_with('{}-{}{}'.format(pathname, i, '.xlsx'))
test_wm._result[i].to_stata.assert_called_once_with('{}-{}{}'.format(pathname, i, '.dta'))
test_wm._result[i].to_html.assert_called_once_with('{}-{}{}'.format(pathname, i, '.html'))
示例2: test_table_1
# 需要导入模块: from vis.workflow import WorkflowManager [as 别名]
# 或者: from vis.workflow.WorkflowManager import _make_table [as 别名]
def test_table_1(self, mock_fdf):
'''
_make_table():
- "count frequency" is True
- file extension on "pathname" with period
'''
test_wm = WorkflowManager([])
test_wm.settings(None, 'count frequency', True) # just to be 100% clear
mock_fdf.return_value = mock.MagicMock(spec_set=pandas.DataFrame)
test_wm._result = mock_fdf.return_value # to avoid a RuntimeError
test_wm._previous_exp = 'intervals' # to get the proper "exp_name"
top_x = None
threshold = None
exp_name = 'Interval Frequency'
pathname = 'test_path'
test_wm._make_table('CSV', pathname + '.csv', top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('Excel', pathname + '.xlsx', top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('Stata', pathname + '.dta', top_x, threshold) # pylint: disable=protected-access
test_wm._make_table('HTML', pathname + '.html', top_x, threshold) # pylint: disable=protected-access
mock_fdf.return_value.to_csv.assert_called_once_with('test_path.csv')
mock_fdf.return_value.to_stata.assert_called_once_with('test_path.dta')
mock_fdf.return_value.to_excel.assert_called_once_with('test_path.xlsx')
mock_fdf.return_value.to_html.assert_called_once_with('test_path.html')
self.assertSequenceEqual([mock.call(top_x=top_x, threshold=threshold, name=exp_name) for _ in range(4)],
mock_fdf.call_args_list)