def test_store():
 ip = get_ipython()
 ip.run_line_magic('load_ext', 'storemagic')
 ip.run_line_magic('store', '-z')
 ip.user_ns['var'] = 42
 ip.run_line_magic('store', 'var')
 ip.user_ns['var'] = 39
 ip.run_line_magic('store', '-r')
 nt.assert_equal(ip.user_ns['var'], 42)
 ip.run_line_magic('store', '-d var')
 ip.user_ns['var'] = 39
 ip.run_line_magic('store', '-r')
 nt.assert_equal(ip.user_ns['var'], 39)

def test_store ( ) : ip = get_ipython ( ) ip . run_line_magic ( 'load_ext' , 'storemagic' ) ip . run_line_magic ( 'store' , '-z' ) ip . user_ns [ 'var' ] = 42 ip . run_line_magic ( 'store' , 'var' ) ip . user_ns [ 'var' ] = 39 ip . run_line_magic ( 'store' , '-r' ) nt . assert_equal ( ip . user_ns [ 'var' ] , 42 ) ip . run_line_magic ( 'store' , '-d var' ) ip . user_ns [ 'var' ] = 39 ip . run_line_magic ( 'store' , '-r' ) nt . assert_equal ( ip . user_ns [ 'var' ] , 39 )
test %store .