Show More
@@ -267,8 +267,8 b' def test_defaults():' | |||||
267 | ) |
|
267 | ) | |
268 |
|
268 | |||
269 | def test_default_values(): |
|
269 | def test_default_values(): | |
270 | @annotate(n=10, f=(0, 10.), g=5) |
|
270 | @annotate(n=10, f=(0, 10.), g=5, h={'a': 1, 'b': 2}, j=['hi', 'there']) | |
271 | def f(n, f=4.5, g=1): |
|
271 | def f(n, f=4.5, g=1, h=2, j='there'): | |
272 | pass |
|
272 | pass | |
273 |
|
273 | |||
274 | c = interactive(f) |
|
274 | c = interactive(f) | |
@@ -285,6 +285,39 b' def test_default_values():' | |||||
285 | cls=widgets.IntSliderWidget, |
|
285 | cls=widgets.IntSliderWidget, | |
286 | value=5, |
|
286 | value=5, | |
287 | ), |
|
287 | ), | |
|
288 | h=dict( | |||
|
289 | cls=widgets.DropdownWidget, | |||
|
290 | values={'a': 1, 'b': 2}, | |||
|
291 | value=2 | |||
|
292 | ), | |||
|
293 | j=dict( | |||
|
294 | cls=widgets.DropdownWidget, | |||
|
295 | values={'hi':'hi', 'there':'there'}, | |||
|
296 | value='there' | |||
|
297 | ), | |||
|
298 | ) | |||
|
299 | ||||
|
300 | def test_default_out_of_bounds(): | |||
|
301 | @annotate(f=(0, 10.), h={'a': 1, 'b': 2}, j=['hi', 'there']) | |||
|
302 | def f(f='hi', h=5, j='other'): | |||
|
303 | pass | |||
|
304 | ||||
|
305 | c = interactive(f) | |||
|
306 | check_widgets(c, | |||
|
307 | f=dict( | |||
|
308 | cls=widgets.FloatSliderWidget, | |||
|
309 | value=5., | |||
|
310 | ), | |||
|
311 | h=dict( | |||
|
312 | cls=widgets.DropdownWidget, | |||
|
313 | values={'a': 1, 'b': 2}, | |||
|
314 | value=1 | |||
|
315 | ), | |||
|
316 | j=dict( | |||
|
317 | cls=widgets.DropdownWidget, | |||
|
318 | values={'hi':'hi', 'there':'there'}, | |||
|
319 | value='hi' | |||
|
320 | ), | |||
288 | ) |
|
321 | ) | |
289 |
|
322 | |||
290 | def test_annotations(): |
|
323 | def test_annotations(): |
General Comments 0
You need to be logged in to leave comments.
Login now