     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
     "outputs": [],
     "source": [
      "print('Dequeue an empty queue')\n",
      "queue = Queue()\n",
      "print(queue.dequeue())\n",
      "print('Enqueue to an empty queue')\n",
 
</s> remove     "print('Dequeue an empty queue')\n",
    "queue = Queue()\n",
    "print(queue.dequeue())\n",
    "print('Enqueue to an empty queue')\n",
    "queue.enqueue(1)\n",
    "print('Dequeue a queue with one element')\n",
    "print(queue.dequeue())\n",
    "print('Enqueue to a non-empty queue')\n",
    "queue.enqueue(2)\n",
    "queue.enqueue(3)\n",
    "queue.enqueue(4)\n",
    "print('Dequeue a queue with more than one element')\n",
    "print(queue.dequeue())\n",
    "print(queue.dequeue())\n",
    "print(queue.dequeue())"
 </s> add     "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    # TODO: It would be better if we had unit tests for each\n",
    "    # method in addition to the following end-to-end test\n",
    "    def test_end_to_end(self):\n",
    "        print('Test: Dequeue an empty queue')\n",
    "        queue = Queue()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue to an empty queue')\n",
    "        queue.enqueue(1)\n",
    "\n",
    "        print('Test: Dequeue a queue with one element')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "\n",
    "        print('Test: Enqueue to a non-empty queue')\n",
    "        queue.enqueue(2)\n",
    "        queue.enqueue(3)\n",
    "        queue.enqueue(4)\n",
    "\n",
    "        print('Test: Dequeue a queue with more than one element')\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "        assert_equal(queue.dequeue(), 3)\n",
    "        assert_equal(queue.dequeue(), 4)\n",
    "        \n",
    "        print('Success: test_end_to_end')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_end_to_end()" </s> remove    "execution_count": null,
 </s> add    "execution_count": 3, </s> remove    "execution_count": null,
 </s> add    "execution_count": 2, </s> remove    "execution_count": null,
 </s> add    "execution_count": 1, </s> remove    "outputs": [],
 </s> add    "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Overwriting queue_list.py\n"
     ]
    }
   ],
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Dequeue an empty queue\n",
      "Test: Enqueue to an empty queue\n",
      "Test: Dequeue a queue with one element\n",
      "Test: Enqueue to a non-empty queue\n",
      "Test: Dequeue a queue with more than one element\n",
      "Success: test_end_to_end\n"
     ]
    }
   ],
     "execution_count": null,
     "metadata": {
      "collapsed": false
     },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Dequeue an empty queue\n",
      "Test: Enqueue to an empty queue\n",
      "Test: Dequeue a queue with one element\n",
      "Test: Enqueue to a non-empty queue\n",
      "Test: Dequeue a queue with more than one element\n",
      "Success: test_end_to_end\n"
     ]
    }
   ],
     "source": [
      "print('Dequeue an empty queue')\n",
      "queue = Queue()\n",
      "print(queue.dequeue())\n",
      "print('Enqueue to an empty queue')\n",
keep keep keep keep replace keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test.  Added linebreak to comment about naming clash with queue. 
stacks-queues/queue-list.ipynb