Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pins/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,9 @@ def pin_write(
"Use .pin_upload() to save a file as a pin."
)

if name is None:
raise ValueError("Pin name must be provided when writing a pin.")

return self._pin_store(
x,
name,
Expand Down
11 changes: 11 additions & 0 deletions pins/tests/test_boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,17 @@ def test_board_pin_write_force_identical_write_msg(
assert len(versions) == 1


@skip_if_dbc
def test_board_pin_write_no_name(board, tmp_path):
df = pd.DataFrame({"x": [1, 2, 3]})

path = tmp_path.joinpath("data.csv")
df.to_csv(path, index=False)

with pytest.raises(ValueError, match=r"Pin name must be provided"):
board.pin_write(path)


@skip_if_dbc
def test_board_pin_download(board_with_cache, tmp_path):
# create and save data
Expand Down
Loading