• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utils.has_no_console_errors函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中tests.integration.utils.has_no_console_errors函数的典型用法代码示例。如果您正苦于以下问题:Python has_no_console_errors函数的具体用法?Python has_no_console_errors怎么用?Python has_no_console_errors使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了has_no_console_errors函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_patches_hover_still_works_when_a_seleciton_is_preselcted

def test_patches_hover_still_works_when_a_seleciton_is_preselcted(output_file_url, selenium):
    # This tests an edge case interaction when Patches (specifically) is used
    # with a tool that requires hit testing e.g. HitTool AND a selection is
    # pre-made on the data source driving it.
    plot = Plot(
        x_range=Range1d(0, 100),
        y_range=Range1d(0, 100),
        min_border=0
    )
    source = ColumnDataSource(dict(
        xs=[[0, 50, 50, 0], [50, 100, 100, 50]],
        ys=[[0, 0, 100, 100], [0, 0, 100, 100]],
        color=['pink', 'blue']
    ))
    source.selected = {
        '0d': {'glyph': None, 'indices': []},
        '1d': {'indices': [1]},
        '2d': {}
    }
    plot.add_glyph(source, Patches(xs='xs', ys='ys', fill_color='color'))
    plot.add_tools(HoverTool())
    plot.add_layout(LinearAxis(), 'below')
    plot.add_layout(LinearAxis(), 'left')
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Hover plot and test no error
    canvas = selenium.find_element_by_tag_name('canvas')
    actions = ActionChains(selenium)
    actions.move_to_element_with_offset(canvas, 100, 100)
    actions.perform()

    # If this assertion fails then there were likely errors on hover
    assert has_no_console_errors(selenium)
开发者ID:complyue,项目名称:bokeh,代码行数:35,代码来源:test_patches_preselection.py


示例2: test_arrow

def test_arrow(output_file_url, selenium, screenshot):

    # Have to specify x/y range as labels aren't included in the plot area solver
    plot = figure(height=HEIGHT, width=WIDTH, x_range=(0,10), y_range=(0,10), tools='', toolbar_location="above")

    arrow1 = Arrow(x_start=1, y_start=3, x_end=6, y_end=8,
                   line_color='green', line_alpha=0.7,
                   line_dash='8 4', line_width=5, end=OpenHead()
                   )
    arrow1.end.line_width=8

    arrow2 = Arrow(x_start=2, y_start=2, x_end=7, y_end=7,
                   start=NormalHead(), end=VeeHead()
                   )
    arrow2.start.fill_color = 'indigo'
    arrow2.end.fill_color = 'orange'
    arrow2.end.size = 50

    plot.add_layout(arrow1)
    plot.add_layout(arrow2)

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Take screenshot
    assert screenshot.is_valid()
开发者ID:Apple3124,项目名称:bokeh,代码行数:28,代码来源:test_arrow.py


示例3: test_label

def test_label(output_file_url, selenium, screenshot):

    # Have to specify x/y range as labels aren't included in the plot area solver
    plot = Plot(plot_height=HEIGHT, plot_width=WIDTH,
                x_range=Range1d(0, 10), y_range=Range1d(0, 10),
                toolbar_location=None)

    label1 = Label(x=1, y=6, x_offset=25, y_offset=25,
                   text="Demo Label",
                   text_font_size='38pt', text_color='red', text_alpha=0.9,
                   text_baseline='bottom', text_align='left',
                   background_fill_color='green', background_fill_alpha=0.2,
                   angle=15, angle_units='deg',
                   render_mode='canvas')

    label2 = Label(x=3, y=5.5, text="(I'm Canvas)", text_font_size='20pt',
                   border_line_color='black', border_line_width=2, border_line_dash='8 4',
                   render_mode='canvas')

    label3 = Label(x=1, y=2, x_offset=25, y_offset=25,
                   text="Demo Label",
                   text_font_size='38pt', text_color='red', text_alpha=0.9,
                   text_baseline='bottom', text_align='left',
                   background_fill_color='green', background_fill_alpha=0.2,
                   angle=0.261, angle_units='rad',
                   render_mode='css')

    label4 = Label(x=3, y=1.0, text="(I'm CSS)", text_font_size='20pt',
                   border_line_color='black', border_line_width=2, border_line_dash='8 4',
                   render_mode='css')

    label_above = Label(
        x=0, y=0, text="Label in above panel", x_units='screen', y_units='screen',
        text_font_size='38pt', text_color='firebrick', text_alpha=0.9,
    )

    label_left = Label(
        x=0, y=0, text="Label in left panel",
        x_units='screen', y_units='screen', angle=90, angle_units='deg',
        text_font_size='18pt', text_color='firebrick', text_alpha=0.9,
        background_fill_color='aliceblue', text_baseline='top',
    )

    plot.add_layout(LinearAxis(), 'below')
    plot.add_layout(LinearAxis(), 'left')

    plot.add_layout(label1)
    plot.add_layout(label2)
    plot.add_layout(label3)
    plot.add_layout(label4)
    plot.add_layout(label_above, 'above')
    plot.add_layout(label_left, 'left')

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Take screenshot
    screenshot.assert_is_valid()
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:60,代码来源:test_label.py


示例4: test_lasso_select

def test_lasso_select(output_file_url, selenium):
    plot = generate_plot()

    #limit to one callback on click release
    plot.add_tools(LassoSelectTool(select_every_mousemove=False))

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Drag a lasso selection area around middle point
    canvas = selenium.find_element_by_tag_name('canvas')

    actions = ActionChains(selenium)
    actions.move_to_element_with_offset(canvas, PLOT_DIM * 0.25, PLOT_DIM * 0.25)
    actions.click_and_hold()
    actions.move_by_offset(0, PLOT_DIM * 0.5)
    actions.move_by_offset(PLOT_DIM * 0.5, 0)
    actions.move_by_offset(0, PLOT_DIM * -0.5)
    actions.release()
    actions.perform()

    # Get the alert from box select and assert that the middle item is selected
    alert = selenium.switch_to_alert()
    assert alert.text == 'middle'
开发者ID:ericmjl,项目名称:bokeh,代码行数:26,代码来源:test_tools.py


示例5: test_color_bar_placement_and_render

def test_color_bar_placement_and_render(output_file_url, selenium, screenshot):
    plot = Plot(height=HEIGHT, width=WIDTH,
                x_range=Range1d(0,10), y_range=Range1d(0,10),
                toolbar_location=None)

    bar_vertical_right_panel = create_vertical_color_bar_with_log_cmap()
    bar_vertical_right_panel.location = (0, 0)

    bar_vertical_in_frame = create_vertical_color_bar_with_log_cmap()
    bar_vertical_in_frame.location = "top_right"
    bar_vertical_in_frame.title = "Dummy Title"
    bar_vertical_in_frame.title_standoff = 7

    bar_horizontal_below_panel = create_horizontal_color_bar_with_linear_cmap()
    bar_horizontal_below_panel.location = (0, 0)

    bar_horizontal_in_frame = create_horizontal_color_bar_with_linear_cmap()
    bar_horizontal_in_frame.location = "bottom_left"
    bar_horizontal_in_frame.title = "Dummy Title"

    plot.add_layout(bar_vertical_right_panel, 'right')
    plot.add_layout(bar_vertical_in_frame)
    plot.add_layout(bar_horizontal_below_panel, 'below')
    plot.add_layout(bar_horizontal_in_frame)

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Take screenshot
    screenshot.assert_is_valid()
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:32,代码来源:test_color_bar.py


示例6: test_reversed_y_range_does_not_pan_below_y_max

def test_reversed_y_range_does_not_pan_below_y_max(output_file_url, selenium):
    y_range_max = 4
    plot = make_pan_plot_with_callback(yr=Range1d(3, 0, bounds=(None, y_range_max)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=50, pan_y=-150)
    new_range_end = float(selenium.execute_script("""alert(window.get_y_range_start())"""))
    selenium.switch_to_alert().dismiss()
    assert round(new_range_end) == y_range_max
开发者ID:rlugojr,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例7: test_reversed_x_range_does_not_pan_left_of_x_max

def test_reversed_x_range_does_not_pan_left_of_x_max(output_file_url, selenium):
    x_range_max = 4
    plot = make_pan_plot_with_callback(xr=Range1d(3, 0, bounds=(None, x_range_max)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=200, pan_y=0)
    new_range_end = float(selenium.execute_script("""alert(window.get_x_range_start())"""))
    selenium.switch_to_alert().dismiss()  # This is not necessary but assists debugging
    assert round(new_range_end) == x_range_max
开发者ID:rlugojr,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例8: test_y_range_does_not_pan_above_y_max

def test_y_range_does_not_pan_above_y_max(output_file_url, selenium):
    y_range_max = 4
    plot = make_pan_plot_with_callback(yr=Range1d(0, 3, bounds=(None, y_range_max)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=50, pan_y=150)
    new_range_end = float(selenium.execute_script("""alert(window.get_y_range_end())"""))
    selenium.switch_to_alert().dismiss()  # This is not necessary but assists debugging
    assert round(new_range_end) == y_range_max
开发者ID:rlugojr,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例9: test_y_range_does_not_pan_below_y_min

def test_y_range_does_not_pan_below_y_min(output_file_url, selenium):
    y_range_min = -1
    plot = make_plot(yr=Range1d(0, 3, bounds=(y_range_min, None)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=50, pan_y=-150)
    new_range_start = float(selenium.execute_script("""alert(Bokeh.index['plot-id'].model.y_range.start)"""))
    selenium.switch_to_alert().dismiss()  # This is not necessary but assists debugging
    assert round(new_range_start) == y_range_min
开发者ID:bgyarfas,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例10: test_reversed_x_range_does_not_pan_right_of_x_min

def test_reversed_x_range_does_not_pan_right_of_x_min(output_file_url, selenium):
    x_range_min = -1
    plot = make_plot(xr=Range1d(3, 0, bounds=(x_range_min, None)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=-150, pan_y=0)
    new_range_start = float(selenium.execute_script("""alert(Bokeh.index['plot-id'].model.x_range.min)"""))
    selenium.switch_to_alert().dismiss()
    assert round(new_range_start) == x_range_min
开发者ID:bgyarfas,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例11: test_x_range_does_not_pan_right_of_x_max

def test_x_range_does_not_pan_right_of_x_max(output_file_url, selenium):
    x_range_max = 4
    plot = make_plot(xr=Range1d(0, 3, bounds=(None, x_range_max)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=-150, pan_y=0)
    new_range_end = float(selenium.execute_script("""alert(Bokeh.index['plot-id'].model.x_range.end)"""))
    selenium.switch_to_alert().dismiss()  # This is not necessary but assists debugging
    assert round(new_range_end) == x_range_max
开发者ID:bgyarfas,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例12: test_x_range_does_not_pan_left_of_x_min

def test_x_range_does_not_pan_left_of_x_min(output_file_url, selenium):
    x_range_min = -1
    plot = make_pan_plot_with_callback(xr=Range1d(0, 3, bounds=(x_range_min, None)))
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Pan plot and test for new range value
    pan_plot(selenium, pan_x=200, pan_y=0)
    new_range_start = float(selenium.execute_script("""alert(window.get_x_range_start())"""))
    selenium.switch_to_alert().dismiss()
    assert round(new_range_start) == x_range_min
开发者ID:rlugojr,项目名称:bokeh,代码行数:12,代码来源:test_range_min_max.py


示例13: test_selection_tool_make_selection

def test_selection_tool_make_selection(output_file_url, selenium):
    plot = make_plot()

    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    perform_box_selection(selenium, (50, 200), (450, 400))

    code = "return Bokeh.index['plot-id'].model.select_one('rect-glyph').data_source.selected['1d'].indices"
    selected = selenium.execute_script(code)
    assert selected == [0, 1]
开发者ID:bgyarfas,项目名称:bokeh,代码行数:12,代码来源:test_selection.py


示例14: test_selection_tool_selection_ending_outside_frame_makes_selection

def test_selection_tool_selection_ending_outside_frame_makes_selection(output_file_url, selenium):
    plot = make_plot()

    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # make selection ending outside of frame
    perform_box_selection(selenium, (50, 50), (1000, 1000))

    code = "return Bokeh.index['plot-id'].model.select_one('rect-glyph').data_source.selected['1d'].indices"
    selected = selenium.execute_script(code)
    assert selected == [0,1,2]
开发者ID:bgyarfas,项目名称:bokeh,代码行数:13,代码来源:test_selection.py


示例15: test_wheel_zoom_is_deselected_by_default

def test_wheel_zoom_is_deselected_by_default(output_file_url, selenium):

    # Make plot and add a taptool callback that generates an alert
    plot = make_plot()

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    # Tap the plot and test for alert
    scroll_button = get_non_stale_scroll_button(selenium)
    scroll_classes = scroll_button.get_attribute('class')
    assert 'active' not in scroll_classes
开发者ID:280185386,项目名称:bokeh,代码行数:14,代码来源:test_wheel_zoom.py


示例16: test_no_border_or_background_fill

def test_no_border_or_background_fill(output_file_url, selenium, screenshot):

    # Have body background-color that should appear through the no-fill plot
    template = Template("""
    <!doctype html>
    <html lang="en">
    <head>
        {{ bokeh_js }}
        {{ bokeh_css}}
        <style>
            body { background-color: lightblue; }
        </style>
    </head>
    <body>
        {{ plot_script }}
        {{ plot_div }}
    </body>
    </html>
    """)

    plot = Plot(plot_height=HEIGHT, plot_width=WIDTH,
                x_range=Range1d(0, 10), y_range=Range1d(0, 10),
                toolbar_location=None)

    # This is the no-fill that we're testing
    plot.background_fill_color = None
    plot.border_fill_color = None

    plot.add_glyph(Circle(x=3, y=3, size=50, fill_color='#ffffff'))
    plot.add_glyph(Circle(x=6, y=6, size=50, fill_color='#ffffff'))

    plot.add_layout(LinearAxis(major_label_text_color='#ffffff',
                               major_label_text_font_size="30pt"),
                    'left')
    plot.add_layout(LinearAxis(major_label_text_color='#ffffff',
                               major_label_text_font_size="30pt"),
                    'below')

    html = file_html(plot, INLINE, template=template)

    # filename has to match test function + '.html' light
    filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                            "test_no_border_or_background_fill.html")

    with io.open(filepath, "w", encoding="utf-8") as f:
        f.write(decode_utf8(html))

    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    screenshot.assert_is_valid()
开发者ID:FourtekIT-incubator,项目名称:bokeh,代码行数:50,代码来源:test_plot_fill_properties.py


示例17: test_visible_property_hides_things_correctly

def test_visible_property_hides_things_correctly(output_file_url, selenium, screenshot):

    plot = figure()
    l1 = plot.line([1, 2, 3], [1, 2, 3])
    l2 = plot.line([1, 2, 3], [2, 4, 6])

    plot.xaxis.visible = False
    plot.ygrid.visible = False
    l1.visible = False

    # Save the plot and start the test
    save(plot)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    assert screenshot.is_valid()
开发者ID:ptitjano,项目名称:bokeh,代码行数:15,代码来源:test_visible_property.py


示例18: test_scale_width_plot_starts_at_correct_size

def test_scale_width_plot_starts_at_correct_size(output_file_url, selenium):
    plot = make_sizing_mode_plot(600, 600, sizing_mode='scale_width')
    save(plot)

    selenium.set_window_size(width=1000, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Canvas width should be just under 1000 * 0.9
    # (default file_html has a body width of 90%)
    assert canvas.size['width'] > 850
    assert canvas.size['width'] < 900
开发者ID:bgyarfas,项目名称:bokeh,代码行数:15,代码来源:test_sizing_mode.py


示例19: test_scale_width_chart_starts_at_correct_size

def test_scale_width_chart_starts_at_correct_size(output_file_url, selenium):
    hist = Histogram(df['mpg'], title="MPG Distribution", sizing_mode='scale_width')
    save(hist)

    selenium.set_window_size(width=1000, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)

    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Canvas width should be just under 1000 * 0.9
    # (default file_html has a body width of 90%)
    assert canvas.size['width'] > 850
    assert canvas.size['width'] < 900
开发者ID:chinasaur,项目名称:bokeh,代码行数:15,代码来源:test_sizing_mode.py


示例20: test_scale_width_maintains_a_minimum_height

def test_scale_width_maintains_a_minimum_height(output_file_url, selenium):
    # The aspect ratio is landscape but should not allow a height less than 100
    plot = make_sizing_mode_plot(1200, 600, sizing_mode='scale_width')
    save(plot)

    # Open the browser with the plot and resize the window small
    selenium.set_window_size(width=100, height=600)
    selenium.get(output_file_url)
    assert has_no_console_errors(selenium)
    canvas = selenium.find_element_by_tag_name('canvas')
    wait_for_canvas_resize(canvas, selenium)

    # Plot should have been shrunk somewhat
    assert canvas.size['height'] < 600
    assert canvas.size['height'] >= 100
开发者ID:bgyarfas,项目名称:bokeh,代码行数:15,代码来源:test_sizing_mode.py



注:本文中的tests.integration.utils.has_no_console_errors函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap