Esempio n. 1
0
	def testIfStringEnteredAsCo_ordinate(self):
		board, error = runTheThing("+++++++++","X","faceplant",0)
		assert error == "Co-ordinate was not in the correct format. Please enter an integer."
Esempio n. 2
0
	def testIfLost(self):
		board, error = runTheThing("x+xo+oxox","o",1,2)
		assert board.won == False
Esempio n. 3
0
	def testForInvalidMove(self):
		board, error = runTheThing("x++++++++","x",0,1)
		assert error == "Invalid move entered (There can only be one more X than the number of Os, and vice versa)."
Esempio n. 4
0
	def testForInvalidBoard(self):
		board, error = runTheThing("xx+++++++",None,None,None)
		assert error == "Invalid board entered (There can only be one more X than the number of Os, and vice versa)."
Esempio n. 5
0
	def testIfCo_ordinateOver2(self):
		board, error = runTheThing("+++++++++","x",1,4)
		assert error == "You have entered an invalid co-ordinate. They must all be 0, 1 or 2."
Esempio n. 6
0
	def testLetterInSamePlace(self):
		board, error = runTheThing("x++++++++","o",0,0)
		assert error == "There is already a letter in that position."
Esempio n. 7
0
	def testIfCo_ordinateLessThan0(self):
		board, error = runTheThing("+++++++++","x",-1,2)
		assert error == "You have entered an invalid co-ordinate. They must all be 0, 1 or 2."
Esempio n. 8
0
	def testIfWon(self):
		board, error = runTheThing("x+xo+oxox","o",1,1)
		assert board.won == True
Esempio n. 9
0
	def testIfInputNotXOOrHyphen(self):
		board, error = runTheThing("+++p+++++","x",1,2)
		assert error == "Input may only contain Xs, Os or +'s."
Esempio n. 10
0
	def testIfInputTooLong(self):
		board, error = runTheThing("+++++++++++","x",1,2)
		assert error == "Input must be nine characters long (X, O and + allowed)."
Esempio n. 11
0
	def testIfNotXOrO(self):
		board, error = runTheThing("+++++++++","p",1,2)
		assert error == "You must place either an X or an O."
Esempio n. 12
0
	def testIfCorrectInput(self):
		board, error = runTheThing("+++++++++","x",1,2)
		assert error == None
Esempio n. 13
0
	def testIfNoInput(self):
		board, error = runTheThing(None, None, None, None)
		assert error == "No board entered. Please enter one."