##// END OF EJS Templates
Merge pull request #7904 from minrk/adapt-not-error...
Merge pull request #7904 from minrk/adapt-not-error make it clearer that we adapt to old messages

File last commit:

r20230:403a37ac
r20574:5b3cabe4 merge
Show More
test_link.py
39 lines | 1.0 KiB | text/x-python | PythonLexer
Min RK
test widget link argument validation
r20185 # Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import nose.tools as nt
Min RK
use jslink, jsdlink for frontend link functions
r20230 from .. import jslink, jsdlink, ToggleButton
Min RK
test widget link argument validation
r20185 from .test_interaction import setup, teardown
Min RK
use jslink, jsdlink for frontend link functions
r20230 def test_jslink_args():
Min RK
test widget link argument validation
r20185 with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jslink()
Min RK
test widget link argument validation
r20185 w1 = ToggleButton()
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jslink((w1, 'value'))
Min RK
test widget link argument validation
r20185
w2 = ToggleButton()
Min RK
use jslink, jsdlink for frontend link functions
r20230 jslink((w1, 'value'), (w2, 'value'))
Min RK
test widget link argument validation
r20185
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jslink((w1, 'value'), (w2, 'nosuchtrait'))
Min RK
test widget link argument validation
r20185
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jslink((w1, 'value'), (w2, 'traits'))
Min RK
test widget link argument validation
r20185
Min RK
use jslink, jsdlink for frontend link functions
r20230 def test_jsdlink_args():
Min RK
test widget link argument validation
r20185 with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jsdlink()
Min RK
test widget link argument validation
r20185 w1 = ToggleButton()
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jsdlink((w1, 'value'))
Min RK
test widget link argument validation
r20185
w2 = ToggleButton()
Min RK
use jslink, jsdlink for frontend link functions
r20230 jsdlink((w1, 'value'), (w2, 'value'))
Min RK
test widget link argument validation
r20185
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jsdlink((w1, 'value'), (w2, 'nosuchtrait'))
Min RK
test widget link argument validation
r20185
with nt.assert_raises(TypeError):
Min RK
use jslink, jsdlink for frontend link functions
r20230 jsdlink((w1, 'value'), (w2, 'traits'))