def testCreateRandomTable(self): self.assertEqual(self.table.numRows(), NROW) self.assertEqual(self.table.numColumns(), NCOL+1) # Include name col NCOLSTR = min(2, NCOL) new_table = DTTable.createRandomTable(TABLE_NAME, NROW, NCOL, ncolstr=NCOLSTR) num_str_col = 0 for n in range(1, NCOL+1): # Added the name column cell = new_table.getColumns()[n].getCells()[0] if isinstance(cell, str): num_str_col += 1 self.assertEqual(num_str_col, NCOLSTR) self.assertEqual(new_table.numColumns(), NCOL + 1) # Include the 'row' column self.assertEqual(new_table.numRows(), NROW)
def setUp(self): self.table = DTTable.createRandomTable(TABLE_NAME, NROW, NCOL)