How to use __check_result method in autotest

Best Python code snippet using autotest_python

code_check.py

Source:code_check.py Github

copy

Full Screen

...86 chessboard[i] = -chessboard[i]87 x, y = np.random.choice(self.chessboard_size, 2)88 chessboard[x, y] = 089 90 if not self.__check_result(chessboard, [[x, y]]):91 return False92 return True93 94 def __check_advance_chessboard (self):95 # win96 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)97 chessboard[0, 0:4] = -198 chessboard[1, 0:4] = 199 if not self.__check_result(chessboard, [[0, 4]]):100 return False101 # 斜赢102 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)103 chessboard[0, 4:6] = 1104 chessboard[0, 7] = 1105 chessboard[1, 3] = -1106 chessboard[2, 4] = -1107 chessboard[3, 5] = -1108 chessboard[4, 6] = -1109 if not self.__check_result(chessboard, [[0, 2], [5, 7]]):110 return False111 # defense 5 inline112 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)113 chessboard[0, 0:2] = -1114 chessboard[0, 7] = -1115 chessboard[1, 1:4] = 1116 if not self.__check_result(chessboard, [[1, 4], [1, 0], [1, 5]]):117 return False118 # 斜defense 5119 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)120 chessboard[2:5, 8] = -1121 chessboard[1, 1] = -1122 chessboard[2, 2] = 1123 chessboard[3, 3] = 1124 chessboard[4, 4] = 1125 chessboard[5, 5] = 1126 if not self.__check_result(chessboard, [[6, 6]]):127 return False128 # two three129 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)130 chessboard[1, 1:3] = -1131 chessboard[2:4, 3] = -1132 chessboard[1, 6:8] = 1133 chessboard[2:4, 8] = 1134 if not self.__check_result(chessboard, [[1, 3]]):135 return False136 # 斜攻双三137 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)138 chessboard[0, 0:2] = 1139 chessboard[0:2, self.chessboard_size - 1] = 1140 chessboard[1, 6] = -1141 chessboard[2, 7] = -1142 chessboard[4, 7] = -1143 chessboard[5, 6] = -1144 if not self.__check_result(chessboard, [[3, 8]]):145 return False146 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)147 chessboard[0, 0:2] = 1148 chessboard[0:2, self.chessboard_size - 1] = 1149 chessboard[1, 6] = -1150 chessboard[2, 5] = -1151 chessboard[4, 5] = -1152 chessboard[5, 6] = -1153 if not self.__check_result(chessboard, [[3, 4]]):154 return False155 # defense156 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)157 chessboard[0, 0:2] = -1158 chessboard[0:2, self.chessboard_size - 1] = -1159 chessboard[1, 6:8] = 1160 chessboard[2:4, 8] = 1161 if not self.__check_result(chessboard, [[0, 8], [1, 8], [4, 8], [5, 8], [1, 5], [1, 9], [1, 10]]):162 return False163 # 斜防双三164 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)165 chessboard[0, 0:2] = -1166 chessboard[0:2, self.chessboard_size - 1] = -1167 chessboard[1, 6] = 1168 chessboard[2, 7] = 1169 chessboard[4, 7] = 1170 chessboard[5, 6] = 1171 if not self.__check_result(chessboard, [[3, 8], [0, 5], [6, 5]]):172 return False173 chessboard = np.zeros((self.chessboard_size, self.chessboard_size), dtype=np.int)174 chessboard[0, 0:2] = -1175 chessboard[0:2, self.chessboard_size - 1] = -1176 chessboard[1, 6] = 1177 chessboard[2, 5] = 1178 chessboard[4, 5] = 1179 chessboard[5, 6] = 1180 if not self.__check_result(chessboard, [[3, 4], [0, 7], [6, 7]]):181 return False...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run autotest automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful