##// END OF EJS Templates
handle undefined when sorting quick help...
handle undefined when sorting quick help since undefined is neither less than nor greater than anything in Javascript, the sort function was treating it as equal to everything, causing inconsistent behavior, depending on the sort algorithm of the browser. This ensures undefined elements are sorted last in the sequence.

File last commit:

r20797:37e32ddc
r20837:320fde26
Show More
test_traits.py
20 lines | 528 B | text/x-python | PythonLexer
"""Test trait types of the widget packages."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from unittest import TestCase
from IPython.utils.traitlets import HasTraits
from IPython.utils.tests.test_traitlets import TraitTestBase
from IPython.html.widgets import Color
class ColorTrait(HasTraits):
value = Color("black")
class TestColor(TraitTestBase):
obj = ColorTrait()
_good_values = ["blue", "#AA0", "#FFFFFF"]
_bad_values = ["vanilla", "blues"]