def test_correct_number_columns_are_passed(columns_4, settings_number_of_columns_4): # pylint: disable=unused-argument """Test that the correct numbers of columns does not raise an error""" instance = DefinedVMCView() rows = instance.process_columns(columns_4) num_cols = len(rows[0]) assert num_cols == 4
def test_same_data_after_processing(columns_2, settings_NUMBER_OF_COLUMNS_2): instance = DefinedVMCView() rows = instance.process_columns(columns_2) gen_columns_from_rows = [] for c in range(len(rows)): column = [] for r in rows[c]: column.append(r) gen_columns_from_rows.append(column) assert gen_columns_from_rows == rows
def test_same_data_after_processing(columns_2, settings_number_of_columns_2): # pylint: disable=unused-argument """Test that the original data can be reconstructed from the processed data, proving the processing worked """ instance = DefinedVMCView() rows = instance.process_columns(columns_2) gen_columns_from_rows = [] num_columns = len(rows) for col in range(num_columns): column = [] for row in rows[col]: column.append(row) gen_columns_from_rows.append(column) assert gen_columns_from_rows == rows
def test_too_many_columns_are_passed(columns_4, settings_number_of_columns_3): # pylint: disable=unused-argument """An error is raised if too many columns are raised""" instance = DefinedVMCView() with pytest.raises(ImproperlyConfigured): instance.process_columns(columns_4)
def test_no_columns_are_passed(settings_number_of_columns_3): # pylint: disable=unused-argument """An error is raised if there are no columns passed""" instance = DefinedVMCView() with pytest.raises(ImproperlyConfigured): instance.process_columns(None)
def test_no_columns_are_passed(settings_NUMBER_OF_COLUMNS_3): # The number of columns passed must correspond to the columns setting instance = DefinedVMCView() with pytest.raises(ImproperlyConfigured): instance.process_columns(None)
def test_correct_number_columns_are_passed(columns_4, settings_NUMBER_OF_COLUMNS_4): instance = DefinedVMCView() rows = instance.process_columns(columns_4) num_cols = len(rows[0]) assert num_cols == 4