Skip to content

Commit c0e9c20

Browse files
author
Roberto Sora
committed
add test for subpath
1 parent b228dca commit c0e9c20

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Diff for: test/test_compile.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from .common import running_on_ci
2121

2222

23-
def test_sketch_new_(run_command):
23+
def test_sketch_new(run_command):
2424
# Create a test sketch in current directory
2525
current_path = os.getcwd()
2626
sketch_name = "SketchNewIntegrationTest"
@@ -38,7 +38,14 @@ def test_sketch_new_(run_command):
3838
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
3939
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
4040

41-
41+
# Create a test sketch in current directory subpath but using an absolute path
42+
sketch_name = "SketchNewIntegrationTestAbsolute"
43+
sketch_subpath = os.path.join("subpath", sketch_name)
44+
current_sketch_path = os.path.join(current_path, sketch_subpath)
45+
result = run_command("sketch new {}".format(current_sketch_path))
46+
assert result.ok
47+
assert "Sketch created in: {}".format(current_sketch_path) in result.stdout
48+
assert os.path.isfile(os.path.join(current_sketch_path, sketch_name + ".ino"))
4249

4350

4451
def test_compile_without_fqbn(run_command):

0 commit comments

Comments
 (0)