def testEditAttributes(self): """Test case - get and extend atttribute names""" try: # dcA = DataCategory("A", self.__attributeList, self.__rowListAsciiA) self.assertEqual(0, dcA.getRowIndex()) self.assertEqual(None, dcA.getCurrentAttribute()) # na = len(dcA.getAttributeList()) tL = dcA.getAttributeListWithOrder() self.assertEqual(len(tL), na) na = len(dcA.getAttributeList()) self.assertEqual(dcA.appendAttribute("ColNew"), na + 1) row = dcA.getFullRow(0) self.assertEqual(row[na], "?") # row = dcA.getFullRow(dcA.getRowCount() + 1) for cV in row: self.assertEqual(cV, "?") # except Exception as e: logger.exception("Failing with %s", str(e)) self.fail()
def test_edit_attributes(self, category_data): dcA = DataCategory('A', category_data['attributeList'], category_data['rowListAsciiA']) assert 0 == dcA.getRowIndex() assert None == dcA.getCurrentAttribute() # na = len(dcA.getAttributeList()) tL = dcA.getAttributeListWithOrder() assert len(tL) == na na = len(dcA.getAttributeList()) assert dcA.appendAttribute("ColNew") == na + 1 row = dcA.getFullRow(0) assert row[na] == "?" # row = dcA.getFullRow(dcA.getRowCount() + 1) for c in row: assert c == "?"