You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
970 B
Python

# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import pytest
from .. import jslink, jsdlink, ToggleButton
def test_jslink_args():
with pytest.raises(TypeError):
jslink()
w1 = ToggleButton()
with pytest.raises(TypeError):
jslink((w1, 'value'))
w2 = ToggleButton()
jslink((w1, 'value'), (w2, 'value'))
with pytest.raises(TypeError):
jslink((w1, 'value'), (w2, 'nosuchtrait'))
with pytest.raises(TypeError):
jslink((w1, 'value'), (w2, 'traits'))
def test_jsdlink_args():
with pytest.raises(TypeError):
jsdlink()
w1 = ToggleButton()
with pytest.raises(TypeError):
jsdlink((w1, 'value'))
w2 = ToggleButton()
jsdlink((w1, 'value'), (w2, 'value'))
with pytest.raises(TypeError):
jsdlink((w1, 'value'), (w2, 'nosuchtrait'))
with pytest.raises(TypeError):
jsdlink((w1, 'value'), (w2, 'traits'))