From 1e797359106b804a7b973b99a2dfa61e6fd10843 Mon Sep 17 00:00:00 2001 From: Ryan Schroder Date: Mon, 25 Nov 2019 15:31:02 -0600 Subject: [PATCH] Removed validate sheet function Validate sheet function and corresponding tests removed. Function is no longer used. Change-Id: I473fa7f4fdb99b306fca465ce9d18e8c8d6e1ed1 --- spyglass_plugin_xls/excel_parser.py | 10 ---------- tests/unit/test_excel_parser.py | 16 ---------------- 2 files changed, 26 deletions(-) diff --git a/spyglass_plugin_xls/excel_parser.py b/spyglass_plugin_xls/excel_parser.py index 4a22224..045af24 100644 --- a/spyglass_plugin_xls/excel_parser.py +++ b/spyglass_plugin_xls/excel_parser.py @@ -60,16 +60,6 @@ class ExcelParser(object): return bool(re.search(self.sanitize(string1), self.sanitize(string2))) - def validate_sheet(self, spec, sheet): - """Check if the sheet is correct or not""" - - ws = self.wb_combined[sheet] - header_row = self.excel_specs["specs"][spec]["header_row"] - ipmi_header = self.excel_specs["specs"][spec]["ipmi_address_header"] - ipmi_column = self.excel_specs["specs"][spec]["ipmi_address_col"] - header_value = ws.cell(row=header_row, column=ipmi_column).value - return bool(self.compare(ipmi_header, header_value)) - def _get_workbook(self, sheet_name, data=None): sheet_name_to_use = sheet_name if data and 'sheet_name' in data: diff --git a/tests/unit/test_excel_parser.py b/tests/unit/test_excel_parser.py index 66831d6..5088c23 100644 --- a/tests/unit/test_excel_parser.py +++ b/tests/unit/test_excel_parser.py @@ -75,22 +75,6 @@ class TestExcelParser(unittest.TestCase): result = obj.compare(test_string1, test_string2) self.assertFalse(result) - @unittest.skip( - 'Ian Pittwood: Not in use. Sheet validation will be redone separately.' - ) - def test_validate_sheet(self): - obj = ExcelParser(EXCEL_FILE_PATH, EXCEL_SPEC_PATH) - result = obj.validate_sheet('xl_spec', 'Site-Information') - self.assertTrue(result) - - @unittest.skip( - 'Ian Pittwood: Not in use. Sheet validation will be redone separately.' - ) - def test_validate_sheet_invalid(self): - obj = ExcelParser(EXCEL_FILE_PATH, INVALID_EXCEL_SPEC_PATH) - result = obj.validate_sheet('xl_spec', 'Site-Information') - self.assertFalse(result) - def test__get_workbook(self): obj = ExcelParser(EXCEL_FILE_PATH, EXCEL_SPEC_PATH) result = obj._get_workbook('Site-Information')