Python - Code Coverage
<p>I'm trying to solve this exercise but I have some difficulties. The aim is:
Achieve full statement coverage on the Queue class. </p>

<ol>
<li>Write your test code in the test function.</li>
<li>Press submit. The grader will tell you if you fail to cover any specific part of the code.</li>
<li>Update your test function until you cover the entire code base.</li>
</ol>

<p>This is the main code:</p>

<pre><code># Enhanced Queue class
class Queue:

    def __init__(self,size_max):
        assert size_max &gt; 0
        self.max = size_max
        self.head = 0
        self.tail = 0
        self.size = 0
        self.data = {}

    def __str__(self):
        return str(self.data)

    def clear(self):       
        self.__init__(self.max)

    def empty(self):       
        return self.size == 0

    def full(self):
        return self.size == self.max

    def enqueue(self,x):
        if type(x) is not int and type(x) is not str and type(x) is not bool:
            return False
        if self.size == self.max:
            return False

        self.data[self.tail] = x
        self.size += 1
        self.tail += 1
        if self.tail == self.max:           
            self.tail = 0
        return True

    def enqueueall(self, c): 
        if type(c) is tuple or type(c) is list: 
            return False

    def dequeue(self):
        if self.size == 0:           
            return None
        x = self.data[self.head]
        self.size -= 1
        self.head += 1
        if self.head == self.max:           
            self.head = 0
        return x 

    def checkRep(self):
        assert self.tail &gt;= 0
        assert self.tail &lt; self.max
        assert self.head &gt;= 0
        assert self.head &lt; self.max
        if self.tail &gt; self.head:
            assert (self.tail-self.head) == self.size
        if self.tail &lt; self.head:
            assert (self.head-self.tail) == (self.max-self.size)
        if self.head == self.tail:
            assert (self.size==0) or (self.size==self.max)
</code></pre>

<p>This is my test code:</p>

<pre><code>def test():
       q = Queue(10)
       assert q
       q.checkRep()

       empty = q.empty()
       assert empty
       q.checkRep()

       full = q.full()
       assert not full
       q.checkRep()

       result = q.dequeue()
       assert result == None
       q.checkRep()  

       result = q.enqueue(10)
       assert result == True
       q.checkRep()  

       result = q.enqueue(20)
       assert result == True
       q.checkRep()  

       empty = q.empty()
       assert not empty
       q.checkRep()

       full = q.full()
       assert full
       q.checkRep()

       result = q.enqueue(30)
       assert result == False
       q.checkRep()  

       result = q.dequeue()
       assert result == 10
       q.checkRep()  

       result = q.dequeue()
       assert result == 20
       q.checkRep()  

test()
</code></pre>

<p>When I compile the code, I have this error
Incorrect. There was a AssertionError. These errors arise for: Assertion failed </p>

<p>Can I have some hints? Thank you!!!</p>
