Uploaded Test files
This commit is contained in:
parent
f584ad9d97
commit
2e81cb7d99
16627 changed files with 2065359 additions and 102444 deletions
|
@ -0,0 +1,28 @@
|
|||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
|
||||
from unittest import TestCase
|
||||
|
||||
from traitlets import TraitError
|
||||
|
||||
from ipywidgets.widgets import Accordion, HTML
|
||||
|
||||
|
||||
class TestAccordion(TestCase):
|
||||
|
||||
def setUp(self):
|
||||
self.children = [HTML('0'), HTML('1')]
|
||||
|
||||
def test_selected_index_none(self):
|
||||
accordion = Accordion(self.children, selected_index=None)
|
||||
state = accordion.get_state()
|
||||
assert state['selected_index'] is None
|
||||
|
||||
def test_selected_index(self):
|
||||
accordion = Accordion(self.children, selected_index=1)
|
||||
state = accordion.get_state()
|
||||
assert state['selected_index'] == 1
|
||||
|
||||
def test_selected_index_out_of_bounds(self):
|
||||
with self.assertRaises(TraitError):
|
||||
Accordion(self.children, selected_index=-1)
|
Loading…
Add table
Add a link
Reference in a new issue