Пример #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."
Пример #2
0
	def testIfLost(self):
		board, error = runTheThing("x+xo+oxox","o",1,2)
		assert board.won == False
Пример #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)."
Пример #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)."
Пример #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."
Пример #6
0
	def testLetterInSamePlace(self):
		board, error = runTheThing("x++++++++","o",0,0)
		assert error == "There is already a letter in that position."
Пример #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."
Пример #8
0
	def testIfWon(self):
		board, error = runTheThing("x+xo+oxox","o",1,1)
		assert board.won == True
Пример #9
0
	def testIfInputNotXOOrHyphen(self):
		board, error = runTheThing("+++p+++++","x",1,2)
		assert error == "Input may only contain Xs, Os or +'s."
Пример #10
0
	def testIfInputTooLong(self):
		board, error = runTheThing("+++++++++++","x",1,2)
		assert error == "Input must be nine characters long (X, O and + allowed)."
Пример #11
0
	def testIfNotXOrO(self):
		board, error = runTheThing("+++++++++","p",1,2)
		assert error == "You must place either an X or an O."
Пример #12
0
	def testIfCorrectInput(self):
		board, error = runTheThing("+++++++++","x",1,2)
		assert error == None
Пример #13
0
	def testIfNoInput(self):
		board, error = runTheThing(None, None, None, None)
		assert error == "No board entered. Please enter one."