Exemplo n.º 1
0
class TestWastePile(unittest.TestCase): 
   
    """
    
    Tests the functionality of a Waste pile.
    
    """

    def setUp(self):
        """Initializes a new Waste pile."""
        self.pile = Waste()

    def tearDown(self):
        """Does nothing."""
        print ""
    
    def test_init(self):
        """Tests the Waste init() function
        
        @todo: FAILURE MESSAGE
        """
        print "waste: test_init ",
        self.assertEqual(self.pile.name, "Waste", 
                         "")
        self.assertEqual(len(self.pile), 0, 
                         "")
    
    def test_maxlen(self):
        """Tests that the Waste pile cannot grow beyond 24 Cards.
        
        @todo: FAILURE MESSAGE
        """
        print "waste: test_maximumSize ",
        self.assertEqual(self.pile.maxlen, 24, 
                         "")
    
    def test_enqueueCard(self):
        """Tests that a Card cannot be enqueued to a Waste pile.
        
        @todo: FAILURE MESSAGE
        """
        print "waste: test_enqueueCard ",
        card = Card('S', 1)
        self.pile.enqueue_card(card)
        self.assertNotIn(card, self.pile, 
                         "")
Exemplo n.º 2
0
 def setUp(self):
     """Initializes a new Waste pile."""
     self.pile = Waste()