Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8b145d5

Browse files
committed
add test_magic, with single test (for rehashx)
1 parent 9e48161 commit 8b145d5

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

IPython/tests/test_magic.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
""" Tests for various magic functions
2+
3+
Needs to be run by nose (to make ipython session available)
4+
5+
"""
6+
def test_rehashx():
7+
# clear up everything
8+
_ip.IP.alias_table.clear()
9+
del _ip.db['syscmdlist']
10+
11+
_ip.magic('rehashx')
12+
# Practically ALL ipython development systems will have more than 10 aliases
13+
14+
assert len(_ip.IP.alias_table) > 10
15+
for key, val in _ip.IP.alias_table.items():
16+
# we must strip dots from alias names
17+
assert '.' not in key
18+
19+
# rehashx must fill up syscmdlist
20+
scoms = _ip.db['syscmdlist']
21+
assert len(scoms) > 10

0 commit comments

Comments
 (0)