test_widget_string.py 769 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (c) Jupyter Development Team.
  2. # Distributed under the terms of the Modified BSD License.
  3. from ..widget_string import Combobox
  4. def test_combobox_creation_blank():
  5. w = Combobox()
  6. assert w.value == ''
  7. assert w.options == ()
  8. assert w.ensure_option == False
  9. def test_combobox_creation_kwargs():
  10. w = Combobox(
  11. value='Chocolate',
  12. options=[
  13. "Chocolate",
  14. "Coconut",
  15. "Mint",
  16. "Strawberry",
  17. "Vanilla",
  18. ],
  19. ensure_option=True
  20. )
  21. assert w.value == 'Chocolate'
  22. assert w.options == (
  23. "Chocolate",
  24. "Coconut",
  25. "Mint",
  26. "Strawberry",
  27. "Vanilla",
  28. )
  29. assert w.ensure_option == True