Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JCZuurmond committed Jun 12, 2024
1 parent 07311b6 commit 3372d63
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/unit/test_dashboards.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@


def test_widget_metadata_replaces_arguments():
widget_metadata = WidgetMetadata(1, 1)
widget_metadata = WidgetMetadata(1, 1, 1)
updated_metadata = widget_metadata.replace_from_arguments(["--width", "10", "--height", "10"])
assert updated_metadata.width == 10
assert updated_metadata.height == 10


@pytest.mark.parametrize("attribute", ["width", "height"])
@pytest.mark.parametrize("attribute", ["order", "width", "height"])
def test_widget_metadata_replaces_one_attribute(attribute: str):
widget_metadata = WidgetMetadata(1, 1)
widget_metadata = WidgetMetadata(1, 1, 1)
updated_metadata = widget_metadata.replace_from_arguments([f"--{attribute}", "10"])

other_fields = [field for field in dataclasses.fields(updated_metadata) if field.name != attribute]
Expand Down

0 comments on commit 3372d63

Please sign in to comment.