Skip to content

Commit

Permalink
fixing failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nadijagraca committed Oct 16, 2023
1 parent 18b9391 commit 8f231ca
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 4 additions & 2 deletions vizro-core/schemas/0.1.5.dev0.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@
},
"RangeSlider": {
"title": "RangeSlider",
"description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `None`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (Optional[str]): Title to be displayed. Defaults to `None`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.",
"description": "Numeric multi-selector `RangeSlider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.RangeSlider`](https://dash.plotly.com/dash-core-components/rangeslider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[List[float]]): Default start and end value for slider. Must be 2 items. Defaults to `None`.\n title (Optional[str]): Title to be displayed. Defaults to `None`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.",
"type": "object",
"properties": {
"id": {
Expand Down Expand Up @@ -533,6 +533,7 @@
"marks": {
"title": "Marks",
"description": "Marks to be displayed on slider.",
"default": {},
"type": "object",
"additionalProperties": {
"type": "string"
Expand Down Expand Up @@ -566,7 +567,7 @@
},
"Slider": {
"title": "Slider",
"description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `None`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (Optional[str]): Title to be displayed. Defaults to `None`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.",
"description": "Numeric single-selector `Slider`.\n\nCan be provided to [`Filter`][vizro.models.Filter] or\n[`Parameter`][vizro.models.Parameter]. Based on the underlying\n[`dcc.Slider`](https://dash.plotly.com/dash-core-components/slider).\n\nArgs:\n type (Literal[\"range_slider\"]): Defaults to `\"range_slider\"`.\n min (Optional[float]): Start value for slider. Defaults to `None`.\n max (Optional[float]): End value for slider. Defaults to `None`.\n step (Optional[float]): Step-size for marks on slider. Defaults to `None`.\n marks (Optional[Dict[float, str]]): Marks to be displayed on slider. Defaults to `{}`.\n value (Optional[float]): Default value for slider. Defaults to `None`.\n title (Optional[str]): Title to be displayed. Defaults to `None`.\n actions (List[Action]): See [`Action`][vizro.models.Action]. Defaults to `[]`.",
"type": "object",
"properties": {
"id": {
Expand Down Expand Up @@ -598,6 +599,7 @@
"marks": {
"title": "Marks",
"description": "Marks to be displayed on slider.",
"default": {},
"type": "object",
"additionalProperties": {
"type": "string"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def expected_range_slider_default():
persistence=True,
min=None,
max=None,
marks={},
marks=None,
value=[None, None],
step=None,
),
Expand Down Expand Up @@ -139,7 +139,7 @@ def test_create_range_slider_mandatory_only(self):

assert hasattr(range_slider, "id")
assert range_slider.type == "range_slider"
assert range_slider.marks == {}
assert range_slider.marks is None
assert range_slider.min is None
assert range_slider.max is None
assert range_slider.step is None
Expand Down Expand Up @@ -261,7 +261,7 @@ def test_invalid_marks(self):
):
vm.RangeSlider(min=1, max=10, marks={"start": 0, "end": 10})

@pytest.mark.parametrize("step, expected", [(1, {}), (None, {})])
@pytest.mark.parametrize("step, expected", [(1, {}), (None, None)])
def test_set_default_marks(self, step, expected):
slider = vm.RangeSlider(min=0, max=10, step=step)
assert slider.marks == expected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_create_slider_mandatory(self):

assert hasattr(slider, "id")
assert slider.type == "slider"
assert slider.marks == {}
assert slider.marks is None
assert slider.min is None
assert slider.max is None
assert slider.step is None
Expand Down Expand Up @@ -178,7 +178,7 @@ def test_invalid_marks(self):
):
vm.Slider(min=1, max=10, marks={"start": 0, "end": 10})

@pytest.mark.parametrize("step, expected", [(1, {}), (None, {})])
@pytest.mark.parametrize("step, expected", [(1, {}), (None, None)])
def test_set_default_marks(self, step, expected):
slider = vm.Slider(min=0, max=10, step=step)
assert slider.marks == expected
Expand Down

0 comments on commit 8f231ca

Please sign in to comment.