Exemplo n.º 1
0
    def test_clear_empty(self):
        """
            Test clear method when list is empty
        """

        dlist = DiskList()

        dlist.clear()

        self.assertTrue(len(dlist) == 0)
Exemplo n.º 2
0
    def test_clear(self):
        """
            Test the clear method
        """

        dlist = DiskList()
        dlist.append('0')
        dlist.append('1')

        dlist.clear()

        self.assertTrue(len(dlist) == 0)
Exemplo n.º 3
0
    def test_clear_not_empty(self):
        """
            Test clear method
        """

        dlist = DiskList()
        dlist.append('0')
        dlist.append('1')
        dlist.append('2')
        dlist.append('3')

        dlist.clear()

        self.assertTrue(len(dlist) == 0)