Skip to content

Commit fc8e7b7

Browse files
author
rsora
committed
Add e2e test for --input-x flags
1 parent 1831bbf commit fc8e7b7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

test/test_upload.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ def test_upload(run_command, data_dir, detected_boards):
3030
# Download core
3131
assert run_command("core install {}".format(board.core))
3232
# Create a sketch
33-
sketch_path = os.path.join(data_dir, "foo")
33+
sketch_name = "foo"
34+
sketch_path = os.path.join(data_dir, sketch_name)
3435
assert run_command("sketch new {}".format(sketch_path))
3536
# Build sketch
3637
assert run_command(
@@ -52,6 +53,19 @@ def test_upload(run_command, data_dir, detected_boards):
5253
)
5354
)
5455

56+
# Upload using --input-dir
57+
assert run_command(
58+
"upload -b {fqbn} -p {port} --input-dir {sketch_path}/build/{fqbn}".format(
59+
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address, sketch_name=sketch_name
60+
)
61+
)
62+
# Upload using --input-file
63+
assert run_command(
64+
"upload -b {fqbn} -p {port} --input-dir {sketch_path}/build/{fqbn}/{sketch_name}.ino.bin".format(
65+
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address, sketch_name=sketch_name
66+
)
67+
)
68+
5569

5670
def test_upload_after_attach(run_command, data_dir, detected_boards):
5771
# Init the environment explicitly

0 commit comments

Comments
 (0)