From 8b145d5b9d4eac71e67020536b1a10c8916c8b84 2008-09-17 19:01:11 From: Ville M. Vainio Date: 2008-09-17 19:01:11 Subject: [PATCH] add test_magic, with single test (for rehashx) --- diff --git a/IPython/tests/test_magic.py b/IPython/tests/test_magic.py new file mode 100644 index 0000000..4228600 --- /dev/null +++ b/IPython/tests/test_magic.py @@ -0,0 +1,21 @@ +""" Tests for various magic functions + +Needs to be run by nose (to make ipython session available) + +""" +def test_rehashx(): + # clear up everything + _ip.IP.alias_table.clear() + del _ip.db['syscmdlist'] + + _ip.magic('rehashx') + # Practically ALL ipython development systems will have more than 10 aliases + + assert len(_ip.IP.alias_table) > 10 + for key, val in _ip.IP.alias_table.items(): + # we must strip dots from alias names + assert '.' not in key + + # rehashx must fill up syscmdlist + scoms = _ip.db['syscmdlist'] + assert len(scoms) > 10