Skip to content

[skip-changelog] Migrate tests from test_board.py to board_test.go #1847

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Oct 11, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Migrated TestBoardAttachWithoutSketchJson from test_board.py to board…
…_test.go
  • Loading branch information
MatteoPologruto committed Oct 7, 2022
commit 94fb509e27cab85c9680c970aee25969ec556a1e
19 changes: 19 additions & 0 deletions internal/integrationtest/board/board_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,22 @@ func TestBoardSearch(t *testing.T) {
}
]`)
}

func TestBoardAttachWithoutSketchJson(t *testing.T) {
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
defer env.CleanUp()

_, _, err := cli.Run("update")
require.NoError(t, err)

sketchName := "BoardAttachWithoutSketchJson"
sketchPath := cli.SketchbookDir().Join(sketchName)
fqbn := "arduino:avr:uno"

// Create a test sketch
_, _, err = cli.Run("sketch", "new", sketchPath.String())
require.NoError(t, err)

_, _, err = cli.Run("board", "attach", "-b", fqbn, sketchPath.String())
require.NoError(t, err)
}
13 changes: 0 additions & 13 deletions test/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@
from .common import running_on_ci


def test_board_attach_without_sketch_json(run_command, data_dir):
run_command(["update"])

sketch_name = "BoardAttachWithoutSketchJson"
sketch_path = Path(data_dir, sketch_name)
fqbn = "arduino:avr:uno"

# Create a test sketch
assert run_command(["sketch", "new", sketch_path])

assert run_command(["board", "attach", "-b", fqbn, sketch_path])


def test_board_search_with_outdated_core(run_command):
assert run_command(["update"])

Expand Down