@@ -38,9 +38,35 @@ def test_upload(run_command, data_dir, detected_boards):
38
38
fqbn = board .fqbn , sketch_path = sketch_path
39
39
)
40
40
)
41
+ # Upload without port must fail
42
+ result = run_command (
43
+ "upload -b {fqbn} {sketch_path}" .format (
44
+ sketch_path = sketch_path , fqbn = board .fqbn , port = board .address
45
+ )
46
+ )
47
+ assert result .failed
41
48
# Upload
42
49
assert run_command (
43
50
"upload -b {fqbn} -p {port} {sketch_path}" .format (
44
51
sketch_path = sketch_path , fqbn = board .fqbn , port = board .address
45
52
)
46
53
)
54
+
55
+
56
+ def test_upload_after_attach (run_command , data_dir , detected_boards ):
57
+ # Init the environment explicitly
58
+ assert run_command ("core update-index" )
59
+
60
+ for board in detected_boards :
61
+ # Download core
62
+ assert run_command ("core install {}" .format (board .core ))
63
+ # Create a sketch
64
+ sketch_path = os .path .join (data_dir , "foo" )
65
+ assert run_command ("sketch new {}" .format (sketch_path ))
66
+ assert run_command (
67
+ "board attach serial://{port} {sketch_path}" .format (port = board .address , sketch_path = sketch_path )
68
+ )
69
+ # Build sketch
70
+ assert run_command ("compile {sketch_path}" .format (sketch_path = sketch_path ))
71
+ # Upload
72
+ assert run_command ("upload {sketch_path}" .format (sketch_path = sketch_path ))
0 commit comments