# DESCRIPTION: Tests the piece classes.

# 4920646f6e5c2774206361726520696620697420776f726b73206f6e20796f7572206d61636869
# 6e652120576520617265206e6f74207368697070696e6720796f7572206d616368696e6521

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# REVIEW: This testing suite needs a serious review when I can be bothered.

import unittest
from lib import pieces, core
from tests.test_core import errormessage

class BasePieceCalls(unittest.TestCase):
    """Tests the base piece and its associated methods."""

    def setUp(self):
        self.piece = pieces.BasePiece(
            'white', '?', [core.Vector(0, 1)], crawler=True)
        return None

    def test_stringcall(self):
        self.assertEqual(
            str(self.piece), 'BasePiece'
        )
        return None

    def test_equality(self):
        piece2 = pieces.BasePiece(
            'black', '?', [core.Vector(0, 1)], crawler=True)

        self.assertEqual(
            self.piece, piece2,
            errormessage(
                "%s =/= %s" % (self.piece, "BasePiece"),
                "%s == %s" % (self.piece, "BasePiece")
            )
        )
        return None

    def test_inequality(self):
        piece2 = pieces.BishopPiece('white')

        self.assertNotEqual(
            self.piece, piece2,
            errormessage(
                "%s == %s" % (self.piece, "BishopPiece"),
                "%s =/= %s" % (self.piece, "BishopPiece")
            )
        )
        return None


class TestKnightPiece(unittest.TestCase):
    """Make sure that the knight is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


class TestBishopPiece(unittest.TestCase):
    """Make sure that the bishop is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


class TestQueenPiece(unittest.TestCase):
    """Make sure that the queen is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


class TestKingPiece(unittest.TestCase):
    """Make sure that the king is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


class TestRookPiece(unittest.TestCase):
    """Make sure that the rook is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


class TestPawnPiece(unittest.TestCase):
    """Make sure that the pawn is behaving correctly."""

    def setUp(self):
        return None

    def tearDown(self):
        return None

    def test_one(self):
        return None


if __name__ == '__main__':
    unittest.main(verbosity=1)

@@ -533,24 +533,62 @@
  methods.%22%22%22
+%0A    # TODO: Finish fleshing this out.
 %0A%0A    def se
@@ -1532,32 +1532,313 @@
    return None%0A%0A
+    def test_type(self):%0A        self.assertTrue(%0A            self.piece.type() is pieces.BasePiece,%0A            errormessage(%0A                %22%25s is not BasePiece%22 %25 str(self.piece),%0A                %22%25s is BasePiece%22 %25 str(self.piece)%0A            )%0A        )%0A        return None%0A%0A
 %0Aclass TestKnigh

Test for the type method in BasePiece