Exemplo n.º 1
0
	def test_appendRow(self, testTable: MockTable):
		assert testTable.numRows == 2

		testTable.appendRow(['2-0', '2-1'])
		assert testTable.numRows == 3

		testTable.appendRows([['3-0', '3-1'], ['4-0', '4-1']])
		assert testTable.numRows == 5
		assert testTable.row(4)[0].val == '4-0'
Exemplo n.º 2
0
	def test_deleteRow(self, testTable: MockTable):
		testTable.deleteRow(0)
		assert testTable.row(0)[0].val == '1-0'
		assert testTable.row(0)[0].row == 0

		testTable.deleteRow('1-0')
		assert testTable.numRows == 0

		with pytest.raises(IndexError):
			testTable.deleteRow(0)
Exemplo n.º 3
0
	def test_row(self, testTable: MockTable):
		assert str(testTable.row(0)[0]) == '0-0'
		assert str(testTable.row('1-0')[1]) == '1-1'