예제 #1
0
    def test_logic(self):
        m = Move(self.allowed_moves[0])

        self.assertTrue(m.clockwise)
        self.assertFalse(m.counterclockwise)
        self.assertFalse(m.double)

        m.double = True
        self.assertFalse(m.clockwise)
        self.assertFalse(m.counterclockwise)
        self.assertTrue(m.double)

        m.double = False
        self.assertTrue(m.clockwise)
        self.assertFalse(m.counterclockwise)
        self.assertFalse(m.double)

        m.counterclockwise = True
        self.assertFalse(m.clockwise)
        self.assertTrue(m.counterclockwise)
        self.assertFalse(m.double)

        m.counterclockwise = False
        self.assertTrue(m.clockwise)
        self.assertFalse(m.counterclockwise)
        self.assertFalse(m.double)
예제 #2
0
    def test_reverse(self):
        m = Move(self.allowed_moves[0])
        m1 = m.reverse()

        self.assertFalse(m1.clockwise)
        self.assertTrue(m1.counterclockwise)
        self.assertFalse(m1.double)

        m.double = True
        m1 = m.reverse()
        self.assertFalse(m1.clockwise)
        self.assertFalse(m1.counterclockwise)
        self.assertTrue(m1.double)

        m.counterclockwise = True
        m1 = m.reverse()
        self.assertTrue(m1.clockwise)
        self.assertFalse(m1.counterclockwise)
        self.assertFalse(m1.double)