def test_edit_row_accessors(self, category_data):
     dcA = DataCategory('A', category_data['attributeList'],
                        category_data['rowListAsciiA'])
     with pytest.raises(IndexError):
         dcA.getRow(dcA.getRowCount() + 1)
     with pytest.raises(IndexError):
         dcA.getRowAttributeDict(dcA.getRowCount() + 1)
     with pytest.raises(IndexError):
         dcA.getRowItemDict(dcA.getRowCount() + 1)
 def test_edit_extend(self, category_data):
     dcA = DataCategory('A', category_data['attributeList'],
                        category_data['rowListAsciiA'])
     na = len(dcA.getAttributeList())
     assert dcA.appendAttributeExtendRows('colNew') == na + 1
     row = dcA.getRow(dcA.getRowCount() - 1)
     assert row[na] == "?"
Example #3
0
 def testEditExtend(self):
     """Test case -  category extension methods"""
     try:
         dcA = DataCategory("A", self.__attributeList, self.__rowListAsciiA)
         na = len(dcA.getAttributeList())
         self.assertEqual(dcA.appendAttributeExtendRows("colNew"), na + 1)
         row = dcA.getRow(dcA.getRowCount() - 1)
         self.assertEqual(row[na], "?")
         #
     except Exception as e:
         logger.exception("Failing with %s", str(e))
         self.fail()