Show More
@@ -1,7 +1,6 b'' | |||
|
1 | 1 | import tempfile, os |
|
2 | 2 | |
|
3 | 3 | from traitlets.config.loader import Config |
|
4 | import nose.tools as nt | |
|
5 | 4 | |
|
6 | 5 | |
|
7 | 6 | def setup_module(): |
@@ -23,10 +22,10 b' def test_store_restore():' | |||
|
23 | 22 | ip.magic('store foobar foobaz') |
|
24 | 23 | |
|
25 | 24 | # Check storing |
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
|
25 | assert ip.db["autorestore/foo"] == 78 | |
|
26 | assert "bar" in ip.db["stored_aliases"] | |
|
27 | assert ip.db["autorestore/foobar"] == 79 | |
|
28 | assert ip.db["autorestore/foobaz"] == "80" | |
|
30 | 29 | |
|
31 | 30 | # Remove those items |
|
32 | 31 | ip.user_ns.pop('foo', None) |
@@ -37,14 +36,14 b' def test_store_restore():' | |||
|
37 | 36 | ip.user_ns['_dh'][:] = [] |
|
38 | 37 | |
|
39 | 38 | # Check restoring |
|
40 |
ip.magic( |
|
|
41 |
|
|
|
42 |
assert ip.alias_manager.is_alias( |
|
|
43 |
|
|
|
44 |
|
|
|
39 | ip.magic("store -r foo bar foobar foobaz") | |
|
40 | assert ip.user_ns["foo"] == 78 | |
|
41 | assert ip.alias_manager.is_alias("bar") | |
|
42 | assert ip.user_ns["foobar"] == 79 | |
|
43 | assert ip.user_ns["foobaz"] == "80" | |
|
45 | 44 | |
|
46 |
ip.magic( |
|
|
47 |
|
|
|
45 | ip.magic("store -r") # restores _dh too | |
|
46 | assert os.path.realpath(tmpd) in ip.user_ns["_dh"] | |
|
48 | 47 | |
|
49 | 48 | os.rmdir(tmpd) |
|
50 | 49 | |
@@ -57,10 +56,10 b' def test_autorestore():' | |||
|
57 | 56 | orig_config = ip.config |
|
58 | 57 | try: |
|
59 | 58 | ip.config = c |
|
60 |
ip.extension_manager.reload_extension( |
|
|
61 |
|
|
|
59 | ip.extension_manager.reload_extension("storemagic") | |
|
60 | assert "foo" not in ip.user_ns | |
|
62 | 61 | c.StoreMagics.autorestore = True |
|
63 |
ip.extension_manager.reload_extension( |
|
|
64 |
|
|
|
62 | ip.extension_manager.reload_extension("storemagic") | |
|
63 | assert ip.user_ns["foo"] == 95 | |
|
65 | 64 | finally: |
|
66 | 65 | ip.config = orig_config |
General Comments 0
You need to be logged in to leave comments.
Login now