##// END OF EJS Templates
add `%matplotlib` and `shell.enable_matplotlib`...
add `%matplotlib` and `shell.enable_matplotlib` Now `%matplotlib` / `enable_matplotlib` do the bulk of the work. `%pylab` / `enable_pylab` just add namespace population on top of that. Related changes: - remove `pylabtools.activate_pylab` - shorten backend message to just `using matplotlib backend: <backend>` - only show backend message when magics are called with `auto`, never from Python methods or when backend is explicit. - pylab clobber warning is only displayed in the magic, not the Python method.

File last commit:

r7875:2549896b
r11328:7ae1fe42
Show More
test_security.py
21 lines | 639 B | text/x-python | PythonLexer
from IPython.lib import passwd
from IPython.lib.security import passwd_check, salt_len
import nose.tools as nt
def test_passwd_structure():
p = passwd('passphrase')
algorithm, salt, hashed = p.split(':')
nt.assert_equal(algorithm, 'sha1')
nt.assert_equal(len(salt), salt_len)
nt.assert_equal(len(hashed), 40)
def test_roundtrip():
p = passwd('passphrase')
nt.assert_equal(passwd_check(p, 'passphrase'), True)
def test_bad():
p = passwd('passphrase')
nt.assert_equal(passwd_check(p, p), False)
nt.assert_equal(passwd_check(p, 'a:b:c:d'), False)
nt.assert_equal(passwd_check(p, 'a:b'), False)