示例#1
0
def test_json_view_size():

    # Build some minimal sprite Parameters
    sprite_params = {'nbSlice': {'X': 4, 'Y': 4, 'Z': 4}}
    width, height = html_stat_map._json_view_size(sprite_params)

    # This is a simple case: height is 4 pixels, width 3 x 4 = 12 pixels
    # with an additional 120% height factor for annotations and margins
    ratio = 1.2 * 4 / 12

    # check we received the expected width and height
    width_exp = 600
    height_exp = np.ceil(ratio * 600)
    assert width == width_exp, "html viewer does not have expected width"
    assert height == height_exp, "html viewer does not have expected height"
def test_json_view_size():

    # Build some minimal sprite Parameters
    sprite_params = {'nbSlice': {'X': 4, 'Y': 4, 'Z': 4}}
    width, height = html_stat_map._json_view_size(sprite_params)

    # This is a simple case: height is 4 pixels, width 3 x 4 = 12 pixels
    # with an additional 120% height factor for annotations and margins
    ratio = 1.2 * 4 / 12

    # check we received the expected width and height
    width_exp = 600
    height_exp = np.ceil(ratio * 600)
    assert width == width_exp, "html viewer does not have expected width"
    assert height == height_exp, "html viewer does not have expected height"