Skip to content

Commit 1986097

Browse files
author
rsora
committed
Refine upload flags testing
1 parent 8fa6c72 commit 1986097

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

test/test_upload.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# software without disclosing the source code of your own applications. To purchase
1414
# a commercial license, send an email to license@arduino.cc.
1515
import os
16+
import time
1617

1718
import pytest
1819

@@ -53,16 +54,23 @@ def test_upload(run_command, data_dir, detected_boards):
5354
)
5455
)
5556

56-
# Upload using --input-dir
57+
# multiple uploads requires some pauses
58+
time.sleep(2)
59+
# Upload using --input-dir reusing standard sketch "build" folder artifacts
5760
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
61+
"upload -b {fqbn} -p {port} --input-dir {sketch_path}/build/{fqbn_path} {sketch_path}".format(
62+
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address,
63+
fqbn_path=board.fqbn.replace(":", ".")
6064
)
6165
)
62-
# Upload using --input-file
66+
67+
# multiple uploads requires some pauses
68+
time.sleep(2)
69+
# Upload using --input-file reusing standard sketch "build" folder artifacts
6370
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
71+
"upload -b {fqbn} -p {port} --input-file {sketch_path}/build/{fqbn_path}/{sketch_name}.ino.bin".format(
72+
sketch_path=sketch_path, fqbn=board.fqbn, port=board.address, sketch_name=sketch_name,
73+
fqbn_path=board.fqbn.replace(":", ".")
6674
)
6775
)
6876

0 commit comments

Comments
 (0)