Show More
@@ -0,0 +1,39 b'' | |||||
|
1 | # Copyright (c) IPython Development Team. | |||
|
2 | # Distributed under the terms of the Modified BSD License. | |||
|
3 | ||||
|
4 | import nose.tools as nt | |||
|
5 | ||||
|
6 | from .. import link, dlink, ToggleButton | |||
|
7 | from .test_interaction import setup, teardown | |||
|
8 | ||||
|
9 | def test_link_args(): | |||
|
10 | with nt.assert_raises(TypeError): | |||
|
11 | link() | |||
|
12 | w1 = ToggleButton() | |||
|
13 | with nt.assert_raises(TypeError): | |||
|
14 | link((w1, 'value')) | |||
|
15 | ||||
|
16 | w2 = ToggleButton() | |||
|
17 | link((w1, 'value'), (w2, 'value')) | |||
|
18 | ||||
|
19 | with nt.assert_raises(TypeError): | |||
|
20 | link((w1, 'value'), (w2, 'nosuchtrait')) | |||
|
21 | ||||
|
22 | with nt.assert_raises(TypeError): | |||
|
23 | link((w1, 'value'), (w2, 'traits')) | |||
|
24 | ||||
|
25 | def test_dlink_args(): | |||
|
26 | with nt.assert_raises(TypeError): | |||
|
27 | dlink() | |||
|
28 | w1 = ToggleButton() | |||
|
29 | with nt.assert_raises(TypeError): | |||
|
30 | dlink((w1, 'value')) | |||
|
31 | ||||
|
32 | w2 = ToggleButton() | |||
|
33 | dlink((w1, 'value'), (w2, 'value')) | |||
|
34 | ||||
|
35 | with nt.assert_raises(TypeError): | |||
|
36 | dlink((w1, 'value'), (w2, 'nosuchtrait')) | |||
|
37 | ||||
|
38 | with nt.assert_raises(TypeError): | |||
|
39 | dlink((w1, 'value'), (w2, 'traits')) |
General Comments 0
You need to be logged in to leave comments.
Login now