pyspread.test package

Submodules

pyspread.test.test_cli module

test_cli

Unit tests for cli.py

pyspread.test.test_cli.insert_path(path)[source]
pyspread.test.test_cli.test_cli(argv, res)[source]

pyspread.test.test_grid module

test_grid

Unit tests for grid.py

class pyspread.test.test_grid.TestGrid[source]

Bases: object

Unit tests for Grid in grid.py

cell_attributes = []
grid = <pyspread.grid.Grid object>
param_test_column = [(0, 0), (1, 1), (100, 0), (1000, 0), (10000, 0), (-1, 0)]
param_test_column_widths = [({0: 23}, {0: 23}), ({1: 3}, {1: 3.0}), ({0: 23, 12: 200}, {0: 23, 12: 200})]
param_test_on_zoom_in = [(0.4, 0.5), (0.5, 0.6), (0.6, 0.7), (0.7, 0.8), (0.8, 1.0), (1.0, 1.2), (1.2, 1.4), (1.4, 1.6), (1.6, 1.8), (1.8, 2.0), (2.0, 2.5), (2.5, 3.0), (3.0, 3.5), (3.5, 4.0), (4.0, 5.0), (5.0, 6.0), (6.0, 8.0), (8.0, 8.0)]
param_test_on_zoom_out = [(0.5, 0.4), (0.6, 0.5), (0.7, 0.6), (0.8, 0.7), (1.0, 0.8), (1.2, 1.0), (1.4, 1.2), (1.6, 1.4), (1.8, 1.6), (2.0, 1.8), (2.5, 2.0), (3.0, 2.5), (3.5, 3.0), (4.0, 3.5), (5.0, 4.0), (6.0, 5.0), (8.0, 6.0), (0.4, 0.4)]
param_test_row = [(0, 0), (1, 1), (100, 100), (1000, 0), (10000, 0), (-1, 0)]
param_test_row_heights = [({0: 23}, {0: 23}), ({1: 3}, {1: 3.0}), ({0: 23, 12: 200}, {0: 23, 12: 200})]
param_test_selected_idx_to_str = [([<PyQt6.QtCore.QModelIndex object>], '(2, 4, 0)'), ([<PyQt6.QtCore.QModelIndex object>, <PyQt6.QtCore.QModelIndex object>], '(2, 4, 0), (3, 4, 0)')]
param_test_selection_blocks = [((0, 0, 1, 1), Selection([(0, 0)], [(1, 1)], [], [], [])), ((1, 2, 14, 19), Selection([(1, 2)], [(14, 19)], [], [], []))]
param_test_selection_cells = [(((0, 0),), Selection([], [], [], [], [(0, 0)])), (((0, 0), (1, 0)), Selection([], [], [], [], [(0, 0), (1, 0)])), (((0, 0), (999, 0)), Selection([], [], [], [], [(0, 0), (999, 0)])), (((0, 0), (1, 0), (0, 1), (1, 1)), Selection([], [], [], [], [(0, 0), (1, 0), (0, 1), (1, 1)]))]
param_test_selection_columns = [((0,), Selection([], [], [], [0], [])), ((1, 2), Selection([], [], [], [1, 2], []))]
param_test_selection_rows = [((0,), Selection([], [], [0], [], [])), ((1, 2), Selection([], [], [1, 2], [], []))]
param_test_set_selection_mode = [(True, (0, 0, 0), (0, 0, 0), <EditTrigger.NoEditTriggers: 0>), (False, (1, 2, 3), None, <EditTrigger.DoubleClicked|EditKeyPressed|AnyKeyPressed: 26>)]
param_test_table = [(0, 0), (1, 1), (3, 0), (-1, 0)]
param_test_zoom = [(1, 1), (2, 2), (8, 8), (0, 1), (100, 1), (-1, 1)]
test_adjust_size()[source]

Unit test for adjust_size

test_column(column, res, monkeypatch)[source]

Unit test for column getter and setter

test_column_widths(widths, widths_res)[source]

Unit test for column_widths

test_current2(row, row_res, column, column_res, monkeypatch)[source]

Unit test for current getter and setter with 2 parameters

test_current3(row, row_res, column, column_res, table, table_res, monkeypatch)[source]

Unit test for current getter and setter with 3 parameters

test_current_invalid()[source]

Unit test for current getter and setter with invalid parameters

test_focusInEvent()[source]

Unit test for focusInEvent

test_has_selection()[source]

Unit test for has_selection

test_is_column_data_discarded()[source]

Unit test for is_column_data_discarded

test_is_row_data_discarded()[source]

Unit test for is_row_data_discarded

test_is_table_data_discarded()[source]

Unit test for is_table_data_discarded

test_on_align_bottom()[source]

Unit test for on_align_bottom

test_on_align_middle()[source]

Unit test for on_align_middle

test_on_align_top()[source]

Unit test for on_align_top

test_on_background_color()[source]

Unit test for on_background_color

test_on_bold_pressed()[source]

Unit test for on_bold_pressed

test_on_column_resized()[source]

Unit test for on_column_resized

test_on_current_changed()[source]

Unit test for on_current_changed

test_on_delete_columns()[source]

Unit test for on_delete_columns

test_on_delete_rows()[source]

Unit test for on_delete_rows

test_on_delete_table()[source]

Unit test for on_delete_table

test_on_font_size()[source]

Unit test for on_font_size

test_on_freeze_pressed()[source]

Unit test for on_freeze_pressed

test_on_image_renderer_pressed()[source]

Unit test for on_image_renderer_pressed

test_on_insert_columns()[source]

Unit test for on_insert_columns

test_on_insert_rows()[source]

Unit test for on_insert_rows

test_on_insert_table()[source]

Unit test for on_insert_table

test_on_italics_pressed()[source]

Unit test for on_italics_pressed

test_on_justify_center()[source]

Unit test for on_justify_center

test_on_justify_fill()[source]

Unit test for on_justify_fill

test_on_justify_left()[source]

Unit test for on_justify_left

test_on_justify_right()[source]

Unit test for on_justify_right

test_on_line_color()[source]

Unit test for on_line_color

test_on_lock_pressed()[source]

Unit test for on_lock_pressed

test_on_markup_renderer_pressed()[source]

Unit test for on_markup_renderer_pressed

test_on_matplotlib_renderer_pressed()[source]

Unit test for on_matplotlib_renderer_pressed

test_on_merge_pressed()[source]

Unit test for on_merge_pressed

test_on_quote()[source]

Unit test for on_quote

test_on_rotate_0()[source]

Unit test for on_rotate_0

test_on_rotate_180()[source]

Unit test for on_rotate_180

test_on_rotate_270()[source]

Unit test for on_rotate_270

test_on_rotate_90()[source]

Unit test for on_rotate_90

test_on_row_resized()[source]

Unit test for on_row_resized

test_on_selection_changed()[source]

Unit test for on_selection_changed

test_on_show_frozen_pressed()[source]

Unit test for on_show_frozen_pressed

test_on_strikethrough_pressed()[source]

Unit test for on_strikethrough_pressed

test_on_text_color()[source]

Unit test for on_text_color

test_on_text_renderer_pressed()[source]

Unit test for on_text_renderer_pressed

test_on_underline_pressed()[source]

Unit test for on_underline_pressed

test_on_zoom_1(zoom)[source]

Unit test for on_zoom_1

test_on_zoom_in(zoom, res)[source]

Unit test for on_zoom_in

test_on_zoom_out(zoom, res)[source]

Unit test for on_zoom_out

test_refresh_frozen_cell()[source]

Unit test for _refresh_frozen_cell

test_refresh_frozen_cells()[source]

Unit test for refresh_frozen_cells

test_refresh_selected_frozen_cells()[source]

Unit test for refresh_selected_frozen_cells

test_row(row, res, monkeypatch)[source]

Unit test for row getter and setter

test_row_heights(heights, heights_res)[source]

Unit test for row_heights

test_selected_idx_to_str(sel_idx, res)[source]

Unit test for _selected_idx_to_str

test_selection_blocks(block, res)[source]

Unit test for selection getter using blocks

test_selection_cells(cells, res)[source]

Unit test for selection getter using cells

test_selection_columns(columns, res)[source]

Unit test for selection getter using columns

test_selection_rows(rows, res)[source]

Unit test for selection getter using rows

test_set_selection_mode(on, current, start, edit_mode)[source]

Unit test for set_selection_mode

test_table(table, res, monkeypatch)[source]

Unit test for table getter and setter

test_update_cell_spans()[source]

Unit test for update_cell_spans

test_update_index_widgets()[source]

Unit test for update_index_widgets

test_zoom(zoom, zoom_res, monkeypatch)[source]

Unit test for zoom getter and setter

class pyspread.test.test_grid.TestGridCellDelegate[source]

Bases: object

Unit tests for GridCellDelegate in grid.py

class pyspread.test.test_grid.TestGridHeaderView[source]

Bases: object

Unit tests for GridHeaderView in grid.py

test_sectionSizeHint()[source]

Unit test for sectionSizeHint

class pyspread.test.test_grid.TestGridTableModel[source]

Bases: object

Unit tests for GridTableModel in grid.py

model = <pyspread.grid.GridTableModel object>
param_test_code = [(0, 0, '', None), (0, 0, 'None', 'None'), (0, 0, '2+6', '2+6'), (1, 1, 'test', 'test')]
param_test_insertColumns = [(0, 5, (0, 0, 0), '0', (0, 5, 0), '0'), (0, 5, (0, 0, 0), '0', (0, 0, 0), None), (0, 0, (0, 0, 0), '0', (0, 0, 0), '0'), (3, 5, (0, 0, 0), '0', (0, 0, 0), '0'), (0, 50, (0, 0, 0), '0', (0, 50, 0), '0')]
param_test_insertRows = [(0, 5, (0, 0, 0), '0', (5, 0, 0), '0'), (0, 5, (0, 0, 0), '0', (0, 0, 0), None), (0, 0, (0, 0, 0), '0', (0, 0, 0), '0'), (3, 5, (0, 0, 0), '0', (0, 0, 0), '0'), (0, 500, (0, 0, 0), '0', (500, 0, 0), '0')]
param_test_insertTable = [(0, (0, 0, 0), '0', (0, 0, 1), '0'), (0, (0, 0, 0), '0', (0, 0, 0), None), (2, (0, 0, 0), '0', (0, 0, 0), '0')]
param_test_removeColumns = [(0, 2, (0, 2, 0), '0', (0, 0, 0), '0'), (0, 2, (0, 0, 0), '0', (0, 0, 0), None), (0, 0, (0, 0, 0), '0', (0, 0, 0), '0'), (3, 1, (0, 0, 0), '0', (0, 0, 0), '0')]
param_test_removeRows = [(0, 5, (5, 0, 0), '0', (0, 0, 0), '0'), (0, 5, (0, 0, 0), '0', (0, 0, 0), None), (0, 0, (0, 0, 0), '0', (0, 0, 0), '0'), (3, 5, (0, 0, 0), '0', (0, 0, 0), '0'), (0, 499, (500, 0, 0), '0', (1, 0, 0), '0')]
param_test_removeTable = [(0, (0, 0, 1), '0', (0, 0, 0), '0'), (0, (0, 0, 0), '0', (0, 0, 0), None), (1, (0, 0, 2), '0', (0, 0, 1), '0')]
param_test_shape = [((1, 1, 1), (1, 1, 1), None), ((0, 0, 0), (1000, 100, 3), <class 'ValueError'>), ((9999999999, 0, 0), (1000, 100, 3), <class 'ValueError'>), ((1000000, 10000, 10), (1000000, 10000, 10), None), ((1000, 100, 3), (1000, 100, 3), None)]
test_code(row, column, code, res)[source]

Unit test for code

test_insertColumns(column, count, key, code, reskey, res)[source]

Unit test for insertColumns

test_insertRows(row, count, key, code, reskey, res)[source]

Unit test for insertRows

test_insertTable(table, key, code, reskey, res)[source]

Unit test for insertTable

test_removeColumns(column, count, key, code, reskey, res)[source]

Unit test for removeColumns

test_removeRows(row, count, key, code, reskey, res)[source]

Unit test for removeRows

test_removeTable(table, key, code, reskey, res)[source]

Unit test for removeTable

test_reset()[source]

Unit test for reset

test_shape(shape, res, error, monkeypatch)[source]

Unit test for shape getter and setter

class pyspread.test.test_grid.TestTableChoice[source]

Bases: object

Unit tests for TableChoice in grid.py

pyspread.test.test_grid.insert_path(path)[source]
pyspread.test.test_grid.multi_selection_mode(grid)[source]

pyspread.test.test_grid_renderer module

test_grid_renderer

Unit tests for grid_renderer.py

class pyspread.test.test_grid_renderer.TestGridCellNavigator[source]

Bases: object

Unit tests for GridCellNavigator in grid_renderer.py

grid = <pyspread.grid.Grid object>
param_test_above_keys = [((0, 0, 0), [(-1, 0, 0)]), ((20, 0, 0), [(19, 0, 0)]), ((20, 0, 2), [(19, 0, 2)]), ((20, 2, 2), [(19, 2, 2)])]
param_test_above_left_key = [((0, 0, 0), (-1, -1, 0)), ((20, 0, 0), (19, -1, 0)), ((20, 0, 2), (19, -1, 2)), ((20, 2, 2), (19, 1, 2))]
param_test_above_right_key = [((0, 0, 0), (-1, 1, 0)), ((20, 0, 0), (19, 1, 0)), ((20, 0, 2), (19, 1, 2)), ((20, 2, 2), (19, 3, 2))]
param_test_below_keys = [((0, 0, 0), [(1, 0, 0)]), ((1000, 0, 0), [(1001, 0, 0)]), ((20, 0, 2), [(21, 0, 2)]), ((20, 2, 2), [(21, 2, 2)])]
param_test_below_left_key = [((0, 0, 0), (1, -1, 0)), ((20, 0, 0), (21, -1, 0)), ((20, 0, 2), (21, -1, 2)), ((20, 2, 2), (21, 1, 2))]
param_test_below_right_key = [((0, 0, 0), (1, 1, 0)), ((20, 0, 0), (21, 1, 0)), ((20, 0, 2), (21, 1, 2)), ((20, 2, 2), (21, 3, 2))]
param_test_left_keys = [((0, 0, 0), [(0, -1, 0)]), ((20, 0, 0), [(20, -1, 0)]), ((20, 0, 2), [(20, -1, 2)]), ((20, 2, 2), [(20, 1, 2)])]
param_test_right_keys = [((0, 0, 0), [(0, 1, 0)]), ((20, 0, 0), [(20, 1, 0)]), ((20, 0, 2), [(20, 1, 2)]), ((20, 2, 2), [(20, 3, 2)])]
test_above_keys(key, res)[source]

Unit test for above_keys

test_above_left_key(key, res)[source]

Unit test for above_left_key

test_above_right_key(key, res)[source]

Unit test for above_right_key

test_below_keys(key, res)[source]

Unit test for below_keys

test_below_left_key(key, res)[source]

Unit test for below_left_key

test_below_right_key(key, res)[source]

Unit test for below_right_key

test_left_keys(key, res)[source]

Unit test for left_keys

test_right_keys(key, res)[source]

Unit test for right_keys

pyspread.test.test_grid_renderer.insert_path(path)[source]

pyspread.test.test_pyspread module

test_grid

Unit tests for grid.py

class pyspread.test.test_pyspread.TestMainWindow[source]

Bases: object

Unit tests for MainWindow in pyspread.py

cell_attributes = []
grid = <pyspread.grid.Grid object>
test_on_clear_globals()[source]

Unit test for on_clear_globals

test_safe_mode()[source]

Unit test for safe_mode

pyspread.test.test_pyspread.insert_path(path)[source]
pyspread.test.test_pyspread.multi_selection_mode(grid)[source]

pyspread.test.test_workflows module

test_workflows

Unit tests for workflows.py

class pyspread.test.test_workflows.TestWorkflows[source]

Bases: object

Unit tests for Workflows in workflows.py

param_count_file_lines = [('', 0, 'counttest.txt', None), ('\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n', 100, 'counttest.txt', None), ('TestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTestTest', 0, 'counttest.txt', None), ('Test\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\n', 10, 'counttest.txt', None), ('Test\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\nTest\n', None, 'false_filename.txt', 'Error')]
param_file_new = [((1000, 100, 3), (1000, 100, 3), None), ((100, 100, 3), (100, 100, 3), None), ((10000000, 100, 3), (1000, 100, 3), 'Error: Grid shape (10000000, 100, 3) exceeds (1000000, 100000, 100).'), (None, (1000, 100, 3), None)]
param_update_main_window_title = [(PosixPath('/root'), 'pyspread'), (PosixPath('/test.pys'), 'test.pys - pyspread')]
test_busy_cursor()[source]

Unit test for busy_cursor

test_count_file_lines(txt, res, filename, msg, tmpdir)[source]

Unit test for count_file_lines

test_edit_sort_ascending()[source]

Unit test for test_edit_sort_ascending

test_edit_sort_descending()[source]

Unit test for test_edit_sort_descending

test_file_new(shape, res, msg, monkeypatch)[source]

Unit test for file_new

test_prevent_updates()[source]

Unit test for prevent_updates

test_reset_changed_since_save()[source]

Unit test for reset_changed_since_save

test_update_main_window_title(path, title)[source]

Unit test for update_main_window_title

workflows = <pyspread.workflows.Workflows object>
pyspread.test.test_workflows.insert_path(path)[source]

Module contents