コード例 #1
0
ファイル: test_Cube.py プロジェクト: yakik/rubikCubeSolver
 def test_rotateBackCounterClockwise(self):
     #Colors for : Front, Back, Right, Left, Top and Bottom  faces
     myRubik = Cube()
     myRubik.rotate_face("BACK", "CCW")
     self.assertEqual("LEFTCOLOR", myRubik.get_color("TOP", "LIF_TOP"))
     self.assertEqual("LEFTCOLOR", myRubik.get_color("TOP", "LIF_TOPRIGHT"))
     self.assertEqual("LEFTCOLOR", myRubik.get_color("TOP", "LIF_TOPLEFT"))
     self.assertEqual("BACKCOLOR",
                      myRubik.get_color("BACK", "LIF_BOTTOMLEFT"))
     myRubik.rotate_face("BACK", "CCW")
     myRubik.rotate_face("BACK", "CCW")
     myRubik.rotate_face("BACK", "CCW")
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP", "LIF_TOP"))
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP", "LIF_TOPRIGHT"))
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP", "LIF_TOPLEFT"))
     self.assertEqual("BACKCOLOR",
                      myRubik.get_color("BACK", "LIF_BOTTOMLEFT"))
コード例 #2
0
ファイル: test_Cube.py プロジェクト: yakik/rubikCubeSolver
 def test_rotateRightClockwise(self):
     #Colors for : Front, Back, Right, Left, Top and Bottom  faces
     myRubik = Cube()
     myRubik.rotate_face("RIGHT", "CW")
     self.assertEqual("FRONTCOLOR", myRubik.get_color("TOP", "LIF_RIGHT"))
     self.assertEqual("FRONTCOLOR",
                      myRubik.get_color("TOP", "LIF_BOTTOMRIGHT"))
     self.assertEqual("FRONTCOLOR",
                      myRubik.get_color("TOP", "LIF_TOPRIGHT"))
     self.assertEqual("RIGHTCOLOR",
                      myRubik.get_color("RIGHT", "LIF_BOTTOMLEFT"))
     myRubik.rotate_face("RIGHT", "CW")
     myRubik.rotate_face("RIGHT", "CW")
     myRubik.rotate_face("RIGHT", "CW")
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP", "LIF_RIGHT"))
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP",
                                                    "LIF_BOTTOMRIGHT"))
     self.assertEqual("TOPCOLOR", myRubik.get_color("TOP", "LIF_TOPRIGHT"))
     self.assertEqual("RIGHTCOLOR",
                      myRubik.get_color("RIGHT", "LIF_BOTTOMLEFT"))