def test_getScriptsAndSettingsFilePaths(self): tableModel = ShotRunnerToolTableModel() tableModel.addRow() tableModel.fileData[1]['scriptFileName'] = 'foo' tableModel.fileData[1]['scriptFilePath'] = 'shoop' tableModel.fileData[1]['settingsFilePath'] = 'baz' settings, scripts = tableModel.getScriptsAndSettingsFilePaths() self.assertEqual(settings[0], 'shoop') self.assertEqual(scripts[0], 'baz')
def test_rowCount(self): tableModel = ShotRunnerToolTableModel() self.assertEqual(tableModel.rowCount(), 1) # check that there is one row by default tableModel.addRow() tableModel.fileData[1]['scriptFileName'] = 'test' self.assertEqual(tableModel.rowCount(), 2) # make sure that there are now 2 rows
def test_close(self): tableModel = ShotRunnerToolTableModel() tableModel.addRow() tableModel.addRow() tableModel.close() self.assertEqual(tableModel.rowCount(), 1)
def test_addRow(self): tableModel = ShotRunnerToolTableModel() self.assertEqual(tableModel.rowCount(), 1) # check that there is one row by default tableModel.addRow() self.assertEqual(tableModel.rowCount(), 2) # check that the number of rows has been incremented