      "collapsed": false
     },
     "outputs": [],
     "source": [
      "print('Dequeue on empty stack')\n",
      "queue = QueueFromStacks()\n",
      "print(queue.dequeue())\n",
      "print('Enqueue on empty stack')\n",
      "print('Enqueue on non-empty stack')\n",
      "print('Multiple enqueue in a row')\n",
      "num_items = 3\n",
      "for i in range (0, num_items):\n",
      "    queue.enqueue(i)\n",
      "print('Dequeue on non-empty stack')\n",
      "print('Dequeue after an enqueue')\n",
      "print(queue.dequeue())\n",
      "print('Multiple dequeue in a row')\n",
      "print(queue.dequeue())\n",
      "print(queue.dequeue())\n",
      "print('Enqueue after a dequeue')\n",
      "queue.enqueue(5)\n",
      "print(queue.dequeue())"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
 
</s> remove    "outputs": [],
 </s> add    "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Test: Dequeue on empty stack\n",
      "Test: Enqueue on empty stack\n",
      "Test: Enqueue on non-empty stack\n",
      "Test: Multiple enqueue in a row\n",
      "Test: Dequeue on non-empty stack\n",
      "Test: Dequeue after an enqueue\n",
      "Test: Multiple dequeue in a row\n",
      "Test: Enqueue after a dequeue\n",
      "Success: test_queue_from_stacks\n"
     ]
    }
   ], </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,
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
      "collapsed": false
     },
     "outputs": [],
     "source": [
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
    "from nose.tools import assert_equal\n",
    "\n",
    "class Test(object):\n",
    "    def test_queue_from_stacks(self):\n",
    "        print('Test: Dequeue on empty stack')\n",
    "        queue = QueueFromStacks()\n",
    "        assert_equal(queue.dequeue(), None)\n",
    "\n",
    "        print('Test: Enqueue on empty stack')\n",
    "        print('Test: Enqueue on non-empty stack')\n",
    "        print('Test: Multiple enqueue in a row')\n",
    "        num_items = 3\n",
    "        for i in range (0, num_items):\n",
    "            queue.enqueue(i)\n",
    "\n",
    "        print('Test: Dequeue on non-empty stack')\n",
    "        print('Test: Dequeue after an enqueue')\n",
    "        assert_equal(queue.dequeue(), 0)\n",
    "\n",
    "        print('Test: Multiple dequeue in a row')\n",
    "        assert_equal(queue.dequeue(), 1)\n",
    "        assert_equal(queue.dequeue(), 2)\n",
    "\n",
    "        print('Test: Enqueue after a dequeue')\n",
    "        queue.enqueue(5)\n",
    "        assert_equal(queue.dequeue(), 5)\n",
    "\n",
    "        print('Success: test_queue_from_stacks')\n",
    "\n",
    "if __name__ == '__main__':\n",
    "    test = Test()\n",
    "    test.test_queue_from_stacks()"
     ]
    }
   ],
   "metadata": {
    "kernelspec": {
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Reworked notebook: Added more detail to constraints and test cases.  Reworked unit test. 
stacks-queues/queue-from-stacks.ipynb