<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 IPython-Unittest / Jupyter Dojo
Testes no Jupyter usando cell magics
João Felipe Nicolaci Pimentel (joaofelipenp@gmail.com)
conda install -c conda-forge jupyter_dojo
Cell Magics + Toolbar
Ou
pip install ipython_unittest
Apenas cell magics
https
Step1:  Other magics
<ASSISTANT_TASK:>
Python Code:
%load_ext ipython_unittest
def add(x, y):
    return x + y
%%unittest
assert add(1, 1) == 2
assert add(1, 2) == 3
assert add(2, 2) == 4
%load_ext ipython_unittest
def fizzbuzz():
    pass
%%unittest -p 1
assert fizzbuzz() == 0
import unittest
import sys
class JupyterTest(unittest.TestCase):
    def test_add_1_1_returns_2(self):
        self.assertEqual(add(1, 1), 2)
    def test_add_1_2_returns_3(self):
        self.assertEqual(add(1, 2), 3)
    def test_add_2_2_returns_4(self):
        self.assertEqual(add(2, 2), 4)
        
suite = unittest.TestLoader().loadTestsFromTestCase(JupyterTest)
unittest.TextTestRunner(verbosity=1, stream=sys.stdout).run(suite)
!pip install astunparse
%%unittest -u
"add 1 + 1 returns 2"
assert add(1, 1) == 2
"add 1 + 2 returns 3"
assert add(1, 2) == 3
"add 2 + 2 returns 4"
assert add(2, 2) == 4
Explanation: IPython-Unittest / Jupyter Dojo
Testes no Jupyter usando cell magics
João Felipe Nicolaci Pimentel (joaofelipenp@gmail.com)
conda install -c conda-forge jupyter_dojo
Cell Magics + Toolbar
Ou
pip install ipython_unittest
Apenas cell magics
https://github.com/JoaoFelipe/ipython-unittest
End of explanation
%%write javascript test.js
var assert = require('assert');
describe('Array', function() {
  describe('#indexOf()', function() {
    it('should return -1 when the value is not present', function() {
      assert.equal(-1, [1,2,3].indexOf(4));
    });
  });
});
%%external --previous 1
mocha test.js
%%unittest_main
class JupyterTest(unittest.TestCase):
    def test_add_1_1_returns_2(self):
        self.assertEqual(add(1, 1), 2)
    def test_add_1_2_returns_3(self):
        self.assertEqual(add(1, 2), 3)
    def test_add_2_2_returns_4(self):
        self.assertEqual(add(2, 2), 4)
%%unittest_testcase
def test_add_1_1_returns_2(self):
    self.assertEqual(add(1, 1), 2)
def test_add_1_2_returns_3(self):
    self.assertEqual(add(1, 2), 3)
def test_add_2_2_returns_4(self):
    self.assertEqual(add(2, 2), 4)
Explanation: Other magics:
End of explanation
<END_TASK>