def test_Int(self): p = Int() with pytest.raises(ValueError) as e: p.validate("junk") assert not str(e).endswith("ValueError")
def test_Int(self): p = Int() with pytest.raises(ValueError) as e: p.validate("junk") assert not str(e).endswith("ValueError")
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")
class HP(HasProps): foo = Int(default=10) bar = String()
class AnotherModelInTestDocument(Model): bar = Int(1)
class SomeDataModel(DataModel): prop0 = Int() prop1 = Int(default=111) prop2 = List(Int, default=[1, 2, 3])
class SomeModelInTestClientServer(Model): foo = Int(2) child = Nullable(Instance(Model))
class T(self.pObjectClass): t = Int(0)
class HasFuncDefaultInt(Model): value = Int(default=next_value)
class SomeModel(Model): a = Int(12) b = String("hello") c = List(Int, [1, 2, 3])
class SomeModelToJson(Model): child = Instance(Model) foo = Int() bar = String()
class Foo(HasProps): x = Int(12) y = String("hello") z = List(Int, [1, 2, 3]) zz = Dict(String, Int) s = Nullable(String(None))
class Foo(HasProps): x = Int(12) ax = Alias('x')
class FooUnrelated(HasProps): x = Int(12) y = String("hello") z = List(Int, [1, 2, 3])
class FooBase(HasProps): x = Int(12)
class AnotherModelInTestFunction(Model): bar = Int(1)
class MapOptions(HasProps): lat = Float lng = Float zoom = Int(12)
class SomeModelInTestFunction(Model): foo = Int(2) child = Instance(Model)
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]})
class AnotherModelInTestApplication(Model): baar = Int(1)
class _TestModel2(HasProps): x = Int(12) y = String("hello") z = List(Int, [1, 2, 3]) zz = Dict(String, Int) s = String(None)
class SomeModelInTestApplication(Model): foo = Int(2) child = Instance(Model)
class EmbedTestUtilModel(Model): a = Int(12) b = String("hello") c = List(Int, [1, 2, 3])
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)
class Foo(Model): foo = Int() bar = List(Int, default=[10]) baz = Int(default=20) quux = List(Int, default=[30])
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)
class AnotherModelInTestClientServer(Model): bar = Int(1)
class SomeModelInTestPushDoc(Model): foo = Int(2) child = Instance(Model)
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 IncludeDefaultsSetToSameTest(HasProps): x = Int(12) y = String("hello")