Beispiel #1
0
 def test_Int(self):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
Beispiel #2
0
 def test_Int(self):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk")
     assert not str(e).endswith("ValueError")
Beispiel #3
0
class Opts(Options):
    """ This is an Options class """

    host = String(default="localhost", help="a host to connect to")
    port = Int(default=5890, help="a port to connect to")
Beispiel #4
0
class HP(HasProps):
    foo = Int(default=10)
    bar = String()
class AnotherModelInTestDocument(Model):
    bar = Int(1)
Beispiel #6
0
class SomeDataModel(DataModel):
    prop0 = Int()
    prop1 = Int(default=111)
    prop2 = List(Int, default=[1, 2, 3])
Beispiel #7
0
class SomeModelInTestClientServer(Model):
    foo = Int(2)
    child = Nullable(Instance(Model))
Beispiel #8
0
 class T(self.pObjectClass):
     t = Int(0)
Beispiel #9
0
 class HasFuncDefaultInt(Model):
     value = Int(default=next_value)
Beispiel #10
0
class SomeModel(Model):
    a = Int(12)
    b = String("hello")
    c = List(Int, [1, 2, 3])
Beispiel #11
0
class SomeModelToJson(Model):
    child = Instance(Model)
    foo = Int()
    bar = String()
Beispiel #12
0
 class Foo(HasProps):
     x = Int(12)
     y = String("hello")
     z = List(Int, [1, 2, 3])
     zz = Dict(String, Int)
     s = Nullable(String(None))
Beispiel #13
0
 class Foo(HasProps):
     x = Int(12)
     ax = Alias('x')
Beispiel #14
0
 class FooUnrelated(HasProps):
     x = Int(12)
     y = String("hello")
     z = List(Int, [1, 2, 3])
Beispiel #15
0
 class FooBase(HasProps):
     x = Int(12)
class AnotherModelInTestFunction(Model):
    bar = Int(1)
Beispiel #17
0
 class MapOptions(HasProps):
     lat = Float
     lng = Float
     zoom = Int(12)
class SomeModelInTestFunction(Model):
    foo = Int(2)
    child = Instance(Model)
Beispiel #19
0
class CDSDerivedDataModel(ColumnDataSource, DataModel):
    prop0 = Int()
    prop1 = Int(default=111)
    prop2 = List(Int, default=[1, 2, 3])

    data = Override(default={"default_column": [4, 5, 6]})
Beispiel #20
0
class AnotherModelInTestApplication(Model):
    baar = Int(1)
Beispiel #21
0
class _TestModel2(HasProps):
    x = Int(12)
    y = String("hello")
    z = List(Int, [1, 2, 3])
    zz = Dict(String, Int)
    s = String(None)
Beispiel #22
0
class SomeModelInTestApplication(Model):
    foo = Int(2)
    child = Instance(Model)
Beispiel #23
0
class EmbedTestUtilModel(Model):
    a = Int(12)
    b = String("hello")
    c = List(Int, [1, 2, 3])
Beispiel #24
0
class DataTabulator(HTMLBox):
    """A Bokeh Model that enables easy use of Tabulator tables
    See http://tabulator.info/
    """

    aggregators = Dict(String, String)

    buttons = Dict(String, String)

    configuration = Dict(String, Any)

    columns = List(Instance(TableColumn),
                   help="""
    The list of child column widgets.
    """)

    download = Bool(default=False)

    children = Dict(Int, Instance(LayoutDOM))

    editable = Bool(default=True)

    expanded = List(Int)

    filename = String(default="table.csv")

    filters = List(Any)

    follow = Bool(True)

    frozen_rows = List(Int)

    groupby = List(String)

    hidden_columns = List(String)

    indexes = List(String)

    layout = Enum('fit_data',
                  'fit_data_fill',
                  'fit_data_stretch',
                  'fit_data_table',
                  'fit_columns',
                  default="fit_data")

    source = Instance(ColumnDataSource)

    styles = Dict(
        String,
        Either(
            String,
            Dict(Int, Dict(Int, List(Either(String, Tuple(String, String)))))))

    pagination = Nullable(String)

    page = Nullable(Int)

    page_size = Int()

    max_page = Int()

    sorters = List(Dict(String, String))

    select_mode = Any()

    selectable_rows = Nullable(List(Int))

    theme = Enum(*TABULATOR_THEMES, default="simple")

    theme_url = String(default=THEME_URL)

    __css_raw__ = CSS_URLS

    @classproperty
    def __css__(cls):
        cls.__css_raw__ = [
            url for url in cls.__css_raw__
            if 'simple' in url or len(cls.__css_raw__) == 1
        ]
        return bundled_files(cls, 'css')

    __javascript_raw__ = [JS_SRC, MOMENT_SRC]

    @classproperty
    def __javascript__(cls):
        return bundled_files(cls)

    @classproperty
    def __js_skip__(cls):
        return {
            'Tabulator': cls.__javascript__[:1],
            'moment': cls.__javascript__[1:]
        }

    __js_require__ = {
        'paths': {
            'tabulator': JS_SRC[:-3],
            'moment': MOMENT_SRC[:-3]
        },
        'exports': {
            'tabulator': 'Tabulator',
            'moment': 'moment'
        }
    }
class SomeModelInTestDocument(Model):
    foo = Int(2)
    child = Instance(Model)
Beispiel #26
0
 class Foo(Model):
     foo = Int()
     bar = List(Int, default=[10])
     baz = Int(default=20)
     quux = List(Int, default=[30])
Beispiel #27
0
 def test_Int(self, detail):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
class AnotherModelInTestPushDoc(Model):
    bar = Int(1)
Beispiel #29
0
class AnotherModelInTestClientServer(Model):
    bar = Int(1)
class SomeModelInTestPushDoc(Model):
    foo = Int(2)
    child = Instance(Model)
Beispiel #31
0
 def test_Int(self, detail):
     p = Int()
     with pytest.raises(ValueError) as e:
         p.validate("junk", detail)
     assert str(e).endswith("ValueError") == (not detail)
Beispiel #32
0
 class IncludeDefaultsSetToSameTest(HasProps):
     x = Int(12)
     y = String("hello")