PEATSA/Core/Tests/UnitTests/TestMatrix.py
def testRowAddition(self):
	
		'''Tests adding a new row
		
		Tests default addition and addition to a specified index.
		Tests that the correct error is raised if index is out of bounds.'''
	
		#Default add
		newRow = ["Adding", "Row"]
		self.matrix.addRow(newRow)
		row = self.matrix.row(2)
		self.assertEqual(row, tuple(newRow))
		self.assertEqual(3, self.matrix.numberOfRows())
				
		#Specified index add
		self.matrix.addRow(newRow, index=1)
		row = self.matrix.row(1)
		self.assertEqual(row, tuple(newRow))
		
		#Test raises an error if index is incorrect
		self.assertRaises(IndexError, self.matrix.addRow, row=newRow, index=10)
		
		#Test raises an error if number of elements in row is incorrect
		self.assertRaises(IndexError, self.matrix.addRow, row=['Wrong'])
Tests adding a new row
		
		Tests default addition and addition to a specified index.
		Tests that the correct error is raised if index is out of bounds.
Tests adding a new row
Tests default addition and addition to a specified index.
Tests that the correct error is raised if index is out of bounds.
Tests adding a new row Tests default addition and addition to a specified index . Tests that the correct error is raised if index is out of bounds .
def testRowAddition(self):
		newRow = ["Adding", "Row"]
		self.matrix.addRow(newRow)
		row = self.matrix.row(2)
		self.assertEqual(row, tuple(newRow))
		self.assertEqual(3, self.matrix.numberOfRows())
		self.matrix.addRow(newRow, index=1)
		row = self.matrix.row(1)
		self.assertEqual(row, tuple(newRow))
		self.assertRaises(IndexError, self.matrix.addRow, row=newRow, index=10)
		self.assertRaises(IndexError, self.matrix.addRow, row=['Wrong'])
def testRowAddition ( self ) : newRow = [ "Adding" , "Row" ] self . matrix . addRow ( newRow ) row = self . matrix . row ( 2 ) self . assertEqual ( row , tuple ( newRow ) ) self . assertEqual ( 3 , self . matrix . numberOfRows ( ) ) self . matrix . addRow ( newRow , index = 1 ) row = self . matrix . row ( 1 ) self . assertEqual ( row , tuple ( newRow ) ) self . assertRaises ( IndexError , self . matrix . addRow , row = newRow , index = 10 ) self . assertRaises ( IndexError , self . matrix . addRow , row = [ 'Wrong' ] )
Tests adding a new row
Tests default addition and addition to a specified index.
Tests adding a new row Tests default addition and addition to a specified index .
'''Tests adding a new row
		
		Tests default addition and addition to a specified index.
		Tests that the correct error is raised if index is out of bounds.''' #Default add #Specified index add #Test raises an error if index is incorrect #Test raises an error if number of elements in row is incorrect
self