示例#1
0
# Module under test
#import bokeh.sampledata.us_marriages_divorces as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.us_marriages_divorces", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.us_marriages_divorces as bsu
    assert isinstance(bsu.data, pd.DataFrame)

    # check detail for package data
    assert len(bsu.data) == 145


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#2
0
    'dodge',
    'factor_cmap',
    'factor_hatch',
    'factor_mark',
    'jitter',
    'linear_cmap',
    'log_cmap',
    'stack',
    'transform',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bt, ALL)

class Test_cumsum(object):

    def test_basic(object):
        s = bt.cumsum("foo")
        assert isinstance(s, dict)
        assert list(s.keys()) == ["expr"]
        assert isinstance(s['expr'], CumSum)
        assert s['expr'].field == 'foo'
        assert s['expr'].include_zero == False

    def test_include_zero(object):
        s = bt.cumsum("foo", include_zero=True)
        assert isinstance(s, dict)
        assert list(s.keys()) == ["expr"]
示例#3
0
# Standard library imports

# External imports

# Bokeh imports
from bokeh._testing.util.api import verify_all

# Module under test
import bokeh.application.handlers as bah

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'CodeHandler',
    'DirectoryHandler',
    'FunctionHandler',
    'Handler',
    'NotebookHandler',
    'ScriptHandler',
    'ServerLifecycleHandler',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bah, ALL)
示例#4
0
# Module under test
#import bokeh.sampledata.us_holidays as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('us_holidays', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.us_holidays", ALL))


@pytest.mark.sampledata
def test_us_holidays():
    import bokeh.sampledata.us_holidays as bsu
    assert isinstance(bsu.us_holidays, list)

    # check detail for package data
    assert len(bsu.us_holidays) == 305


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#5
0
# Module under test
#import bokeh.sampledata.us_states as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.us_states", ALL))

@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.us_states as bsu
    assert isinstance(bsu.data, dict)

    # check detail for package data
    assert len(bsu.data) == 51

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#6
0
# Module under test
#import bokeh.sampledata.degrees as bsd

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.degrees", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.degrees as bsd
    assert isinstance(bsd.data, pd.DataFrame)

    # check detail for package data
    assert len(bsd.data) == 42


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#7
0
# Module under test
#import bokeh.sampledata.movies_data as bsm

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'movie_path',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.movies_data", ALL))

@pytest.mark.sampledata
def test_movie_path():
    import bokeh.sampledata.movies_data as bsm
    assert isinstance(bsm.movie_path, string_types)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#8
0
#import bokeh.sampledata.perceptions as bsp

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'numberly',
    'probly',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.perceptions", ALL))

@pytest.mark.sampledata
def test_numberly(pd):
    import bokeh.sampledata.perceptions as bsp
    assert isinstance(bsp.numberly, pd.DataFrame)

    # check detail for package data
    assert len(bsp.numberly) == 46

@pytest.mark.sampledata
def test_probly(pd):
    import bokeh.sampledata.perceptions as bsp
    assert isinstance(bsp.probly, pd.DataFrame)

    # check detail for package data
示例#9
0
# Module under test
#import bokeh.sampledata.commits as bsc

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.commits", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.commits as bsc
    assert isinstance(bsc.data, pd.DataFrame)

    # check detail for package data
    assert len(bsc.data) == 4916

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#10
0
# Module under test
#import bokeh.sampledata.autompg2 as bsa

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'autompg2',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.autompg2", ALL))

@pytest.mark.sampledata
def test_autompg2(pd):
    import bokeh.sampledata.autompg2 as bsa
    assert isinstance(bsa.autompg2, pd.DataFrame)

    # check detail for package data
    assert len(bsa.autompg2) == 234

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#11
0
# Module under test
#import bokeh.sampledata.degrees as bsd

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.degrees", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.degrees as bsd
    assert isinstance(bsd.data, pd.DataFrame)

    # check detail for package data
    assert len(bsd.data) == 42

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#12
0
# Module under test
#import bokeh.sampledata.daylight as bsd

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'daylight_warsaw_2013',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.daylight", ALL))

@pytest.mark.sampledata
def test_daylight_warsaw_2013(pd):
    import bokeh.sampledata.daylight as bsd
    assert isinstance(bsd.daylight_warsaw_2013, pd.DataFrame)

    # check detail for package data
    assert len(bsd.daylight_warsaw_2013) == 365

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#13
0
# Module under test
#import bokeh.sampledata.glucose as bsg

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.glucose", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.glucose as bsg
    assert isinstance(bsg.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#14
0
#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'fertility',
    'life_expectancy',
    'population',
    'regions',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.gapminder", ALL))

@pytest.mark.sampledata
@pytest.mark.parametrize('name', ['fertility', 'life_expectancy', 'population', 'regions'])
def test_data(pd, name):
    import bokeh.sampledata.gapminder as bsg
    data = getattr(bsg, name)
    assert isinstance(data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#15
0
# Module under test
#import bokeh.sampledata.les_mis as bsl

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.les_mis", ALL))


@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.les_mis as bsl
    assert isinstance(bsl.data, dict)

    # check detail for package data
    assert set(bsl.data.keys()) == set(['links', 'nodes'])


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
# Module under test
#import bokeh.sampledata.sea_surface_temperature as bss

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'sea_surface_temperature',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.sea_surface_temperature", ALL))

@pytest.mark.sampledata
def test_sea_surface_temperature(pd):
    import bokeh.sampledata.sea_surface_temperature as bss
    assert isinstance(bss.sea_surface_temperature, pd.DataFrame)

    # check detail for package data
    assert len(bss.sea_surface_temperature) == 19226

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#17
0
# Standard library imports

# External imports

# Bokeh imports
from bokeh._testing.util.api import verify_all

# Module under test
import bokeh.application.handlers as bah

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'CodeHandler',
    'DirectoryHandler',
    'FunctionHandler',
    'Handler',
    'NotebookHandler',
    'ScriptHandler',
    'ServerLifecycleHandler',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bah, ALL)
示例#18
0
# Module under test
#import bokeh.sampledata.sample_geojson as bss

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'geojson',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.sample_geojson", ALL))

@pytest.mark.sampledata
def test_geojson():
    import bokeh.sampledata.sample_geojson as bsg
    assert isinstance(bsg.geojson, string_types)

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#19
0
#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'numberly',
    'probly',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.perceptions", ALL))


@pytest.mark.sampledata
def test_numberly(pd) -> None:
    import bokeh.sampledata.perceptions as bsp
    assert isinstance(bsp.numberly, pd.DataFrame)

    # check detail for package data
    assert len(bsp.numberly) == 46


@pytest.mark.sampledata
def test_probly(pd) -> None:
    import bokeh.sampledata.perceptions as bsp
    assert isinstance(bsp.probly, pd.DataFrame)
示例#20
0
# Module under test
#import bokeh.sampledata.movies_data as bsm # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('movie_path', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.movies_data", ALL))


@pytest.mark.sampledata
def test_movie_path() -> None:
    import bokeh.sampledata.movies_data as bsm
    assert isinstance(bsm.movie_path, str)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#21
0
# Module under test
#import bokeh.sampledata.commits as bsc # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.commits", ALL))

@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.commits as bsc
    assert isinstance(bsc.data, pd.DataFrame)

    # check detail for package data
    assert len(bsc.data) == 4916

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#22
0
#import bokeh.sampledata.browsers as bsb

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'browsers_nov_2013',
    'icons',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.browsers", ALL))

@pytest.mark.sampledata
def test_browsers_nov_2013(pd):
    import bokeh.sampledata.browsers as bsb
    assert isinstance(bsb.browsers_nov_2013, pd.DataFrame)

    # check detail for package data
    assert len(bsb.browsers_nov_2013) == 118

@pytest.mark.sampledata
def test_icons():
    import bokeh.sampledata.browsers as bsb
    assert isinstance(bsb.icons, dict)

    # check detail for package data
示例#23
0
# Module under test
import bokeh.settings as bs

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('settings', )

logging.basicConfig(level=logging.DEBUG)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bs, ALL)

_expected_settings = (
    'allowed_ws_origin',
    'browser',
    'docs_cdn',
    'docs_version',
    'ignore_filename',
    'log_level',
    'minified',
    'nodejs_path',
    'perform_document_validation',
    'phantomjs_path',
    'pretty',
    'py_log_level',
    'resources',
示例#24
0
# Module under test
#import bokeh.sampledata.commits as bsc

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.commits", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.commits as bsc
    assert isinstance(bsc.data, pd.DataFrame)

    # check detail for package data
    assert len(bsc.data) == 4916


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#25
0
# Module under test
#import bokeh.sampledata.airports as bsa

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.airports", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.airports as bsa
    assert isinstance(bsa.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#26
0
# Module under test
#import bokeh.sampledata.population as bsp # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.population", ALL))

@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.population as bsp
    assert isinstance(bsp.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

class Child(bcpdf.PropertyDescriptorFactory):
    pass

def test_autocreate():
    obj = Child()
    value = obj.autocreate()
    assert isinstance(value, Child)

def test_make_descriptors_not_implemented():
    obj = bcpdf.PropertyDescriptorFactory()
    with pytest.raises(NotImplementedError):
        obj.make_descriptors("foo")

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bcpdf, ALL)
示例#28
0
# Module under test
#import bokeh.sampledata.periodic_table as bsp # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('elements', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.periodic_table", ALL))


@pytest.mark.sampledata
def test_elements(pd) -> None:
    import bokeh.sampledata.periodic_table as bsp
    assert isinstance(bsp.elements, pd.DataFrame)

    # check detail for package data
    assert len(bsp.elements) == 118


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#29
0
# Module under test
#import bokeh.sampledata.unemployment as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.unemployment", ALL))

@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.unemployment as bsu
    assert isinstance(bsu.data, dict)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#30
0
# Module under test
#import bokeh.sampledata.sea_surface_temperature as bss # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('sea_surface_temperature', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.sea_surface_temperature", ALL))


@pytest.mark.sampledata
def test_sea_surface_temperature(pd) -> None:
    import bokeh.sampledata.sea_surface_temperature as bss
    assert isinstance(bss.sea_surface_temperature, pd.DataFrame)

    # check detail for package data
    assert len(bss.sea_surface_temperature) == 19226


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#31
0
# Module under test
#import bokeh.sampledata.airports as bsa

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.airports", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.airports as bsa
    assert isinstance(bsa.data, pd.DataFrame)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#32
0
# Module under test
#import bokeh.sampledata.haar_cascade as bsh

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'frontalface_default_path',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.haar_cascade", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.haar_cascade as bsh
    assert isinstance(bsh.frontalface_default_path, string_types)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#33
0
# Module under test
#import bokeh.sampledata.world_cities as bsw # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.world_cities", ALL))


@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.world_cities as bsw
    assert isinstance(bsw.data, pd.DataFrame)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#34
0
# Module under test
#import bokeh.sampledata.olympics2014 as bso

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.olympics2014", ALL))

@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.olympics2014 as bso
    assert isinstance(bso.data, dict)

    # check detail for package data
    assert set(bso.data.keys()) == set(['count', 'data', 'object'])

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#35
0
#-----------------------------------------------------------------------------

ALL = (
    'AAPL',
    'FB',
    'GOOG',
    'IBM',
    'MSFT',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.stocks", ALL))


@pytest.mark.sampledata
@pytest.mark.parametrize('name', ['AAPL', 'FB', 'GOOG', 'IBM', 'MSFT'])
def test_data(name) -> None:
    import bokeh.sampledata.stocks as bss
    data = getattr(bss, name)
    assert isinstance(data, dict)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#36
0
# Module under test
#import bokeh.sampledata.sprint as bss # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('sprint', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.sprint", ALL))


@pytest.mark.sampledata
def test_sprint(pd) -> None:
    import bokeh.sampledata.sprint as bss
    assert isinstance(bss.sprint, pd.DataFrame)

    # check detail for package data
    assert len(bss.sprint) == 85


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#37
0
# Module under test
#import bokeh.sampledata.us_cities as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.us_cities", ALL))


@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.us_cities as bsu
    assert isinstance(bsu.data, dict)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#38
0
# Module under test
#import bokeh.sampledata.unemployment as bsu # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.unemployment", ALL))


@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.unemployment as bsu
    assert isinstance(bsu.data, dict)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#39
0
# Module under test
#import bokeh.sampledata.us_states as bsu # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.us_states", ALL))

@pytest.mark.sampledata
def test_data() -> None:
    import bokeh.sampledata.us_states as bsu
    assert isinstance(bsu.data, dict)

    # check detail for package data
    assert len(bsu.data) == 51

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#40
0
# Module under test
#import bokeh.sampledata.commits as bsc # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.anscombe", ALL))


@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.anscombe as bsa
    assert isinstance(bsa.data, pd.DataFrame)

    # check detail for package data
    assert len(bsa.data) == 11
    assert list(bsa.data.columns) == [
        "Ix", "Iy", "IIx", "IIy", "IIIx", "IIIy", "IVx", "IVy"
    ]


#-----------------------------------------------------------------------------
示例#41
0
# Module under test
#import bokeh.sampledata.autompg2 as bsa # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('autompg2', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.autompg2", ALL))


@pytest.mark.sampledata
def test_autompg2(pd) -> None:
    import bokeh.sampledata.autompg2 as bsa
    assert isinstance(bsa.autompg2, pd.DataFrame)

    # check detail for package data
    assert len(bsa.autompg2) == 234


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#42
0
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'AAPL',
    'FB',
    'GOOG',
    'IBM',
    'MSFT',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.stocks", ALL))

@pytest.mark.sampledata
@pytest.mark.parametrize('name', ['AAPL', 'FB', 'GOOG', 'IBM', 'MSFT'])
def test_data(name):
    import bokeh.sampledata.stocks as bss
    data = getattr(bss, name)
    assert isinstance(data, dict)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#43
0
# Module under test
#import bokeh.sampledata.sprint as bss

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'sprint',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.sprint", ALL))

@pytest.mark.sampledata
def test_sprint(pd):
    import bokeh.sampledata.sprint as bss
    assert isinstance(bss.sprint, pd.DataFrame)

    # check detail for package data
    assert len(bss.sprint) == 85

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#44
0
# Module under test
#import bokeh.sampledata.glucose as bsg

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.glucose", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.glucose as bsg
    assert isinstance(bsg.data, pd.DataFrame)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#45
0
    v = Foo(x=1).equals(Foo(x=2))
    assert v is False

    v = Foo(x=1).equals(1)
    assert v is False

    v = Foo().equals(FooUnrelated())
    assert v is False

def test_HasProps_clone() -> None:
    p1 = Plot(plot_width=1000)
    c1 = p1.properties_with_values(include_defaults=False)
    p2 = p1._clone()
    c2 = p2.properties_with_values(include_defaults=False)
    assert c1 == c2

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bcp, ALL)
#import bokeh.sampledata.autompg as bsa

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'autompg',
    'autompg_clean',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.autompg", ALL))

@pytest.mark.sampledata
def test_autompg(pd):
    import bokeh.sampledata.autompg as bsa
    assert isinstance(bsa.autompg, pd.DataFrame)

    # check detail for package data
    assert len(bsa.autompg) == 392
    assert all(x in [1,2,3] for x in bsa.autompg.origin)

@pytest.mark.sampledata
def test_autompg_clean(pd):
    import bokeh.sampledata.autompg as bsa
    assert isinstance(bsa.autompg_clean, pd.DataFrame)
# Module under test
#import bokeh.sampledata.us_marriages_divorces as bsu

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.us_marriages_divorces", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.us_marriages_divorces as bsu
    assert isinstance(bsu.data, pd.DataFrame)

    # check detail for package data
    assert len(bsu.data) == 145

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#48
0
# Module under test
#import bokeh.sampledata.daylight as bsd # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('daylight_warsaw_2013', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.daylight", ALL))


@pytest.mark.sampledata
def test_daylight_warsaw_2013(pd) -> None:
    import bokeh.sampledata.daylight as bsd
    assert isinstance(bsd.daylight_warsaw_2013, pd.DataFrame)

    # check detail for package data
    assert len(bsd.daylight_warsaw_2013) == 365


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------
示例#49
0
# Module under test
#import bokeh.sampledata.world_cities as bsw

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.world_cities", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.world_cities as bsw
    assert isinstance(bsw.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#50
0
# Module under test
#import bokeh.sampledata.haar_cascade as bsh # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('frontalface_default_path', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.haar_cascade", ALL))


@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.haar_cascade as bsh
    assert isinstance(bsh.frontalface_default_path, str)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#51
0
# Module under test
#import bokeh.sampledata.les_mis as bsl

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.les_mis", ALL))

@pytest.mark.sampledata
def test_data():
    import bokeh.sampledata.les_mis as bsl
    assert isinstance(bsl.data, dict)

    # check detail for package data
    assert set(bsl.data.keys()) == set(['links', 'nodes'])


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#52
0
# Module under test
#import bokeh.sampledata.airports as bsa # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.airports", ALL))

@pytest.mark.sampledata
def test_data(pd) -> None:
    import bokeh.sampledata.airports as bsa
    assert isinstance(bsa.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------
示例#53
0
# Module under test
#import bokeh.sampledata.periodic_table as bsp

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'elements',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.periodic_table", ALL))

@pytest.mark.sampledata
def test_elements(pd):
    import bokeh.sampledata.periodic_table as bsp
    assert isinstance(bsp.elements, pd.DataFrame)

    # check detail for package data
    assert len(bsp.elements) == 118

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
示例#54
0
# Module under test
#import bokeh.sampledata.population as bsp # isort:skip

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = ('data', )

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(
    verify_all("bokeh.sampledata.population", ALL))


@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.population as bsp
    assert isinstance(bsp.data, pd.DataFrame)

    # don't check detail for external data


#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
示例#55
0
        assert not prop.is_valid(1.0)
        assert not prop.is_valid(1.0+1.0j)

        assert not prop.is_valid(())
        assert not prop.is_valid([])
        assert not prop.is_valid({})
        assert not prop.is_valid(_TestHasProps())
        assert not prop.is_valid(_TestModel())

    def test_has_ref(self):
        prop = bcpr.Regex("")
        assert not prop.has_ref

    def test_str(self):
        prop = bcpr.Regex("")
        assert str(prop).startswith("Regex(")

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------

Test___all__ = verify_all(bcpr, ALL)
示例#56
0
# Module under test
#import bokeh.sampledata.population as bsp

#-----------------------------------------------------------------------------
# Setup
#-----------------------------------------------------------------------------

ALL = (
    'data',
)

#-----------------------------------------------------------------------------
# General API
#-----------------------------------------------------------------------------

Test___all__ = pytest.mark.sampledata(verify_all("bokeh.sampledata.population", ALL))

@pytest.mark.sampledata
def test_data(pd):
    import bokeh.sampledata.population as bsp
    assert isinstance(bsp.data, pd.DataFrame)

    # don't check detail for external data

#-----------------------------------------------------------------------------
# Dev API
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Private API
#-----------------------------------------------------------------------------