def test_compute_query_dict(self, range, query): bl = BaseLine(x="key", y="val") bl.min_value = self.dashboard._data[bl.x].min() bl.max_value = self.dashboard._data[bl.x].max() bl.stride = 1 if bl.data_points > self.dashboard._data[bl.x].shape[0]: bl.data_points = self.dashboard._data[bl.x].shape[0] bl.add_range_slider_filter(self.dashboard) self.dashboard.add_charts([bl]) bl.filter_widget.value = range # test the following function behavior bl.compute_query_dict(self.dashboard._query_str_dict) assert self.dashboard._query_str_dict["key_line"] == query
def test_compute_query_dict(self, range, query, local_dict): bb = BaseLine(x="key", y="val", title="custom_title") bb.chart_type = "non_aggregate_line" self.dashboard.add_charts([bb]) bb.filter_widget.value = range # test the following function behavior bb.compute_query_dict( self.dashboard._query_str_dict, self.dashboard._query_local_variables_dict, ) assert (self.dashboard._query_str_dict[ "key_val_non_aggregate_line_custom_title"] == query) for key in local_dict: assert (self.dashboard._query_local_variables_dict[key] == local_dict[key])
def test_compute_query_dict(self, dashboard, x_range, y_range, query, local_dict): bl = BaseLine(x="x", y="y", title="custom_title") bl.chart_type = "non_aggregate_line" bl.box_selected_range = local_dict bl.chart = hv.InteractiveDatashader() bl.x_range = x_range bl.y_range = y_range dashboard.add_charts([bl]) # test the following function behavior bl.compute_query_dict( dashboard._query_str_dict, dashboard._query_local_variables_dict, ) assert ( dashboard._query_str_dict["x_y_non_aggregate_line_custom_title"] == query) for key in local_dict: assert ( dashboard._query_local_variables_dict[key] == local_dict[key])