Removed validate sheet function
Validate sheet function and corresponding tests removed. Function is no longer used. Change-Id: I473fa7f4fdb99b306fca465ce9d18e8c8d6e1ed1
This commit is contained in:
parent
c9d3ad98f7
commit
1e79735910
@ -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:
|
||||
|
@ -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')
|
||||
|
Loading…
x
Reference in New Issue
Block a user