Skip to content

Commit 6c219da

Browse files
Migrate TestSketchArchiveRelativeSketchPathWithIncludeBuildDirFlag from test_sketch.py to sketch_test.go
1 parent 57ffd2f commit 6c219da

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

internal/integrationtest/sketch/sketch_test.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -583,3 +583,17 @@ func TestSketchArchiveDotCustomZipPathAndNameWithExtensionWithIncludeBuildDirFla
583583
defer require.NoError(t, archive.Close())
584584
verifyZipContainsSketchIncludingBuildDir(t, archive.File)
585585
}
586+
587+
func TestSketchArchiveRelativeSketchPathWithIncludeBuildDirFlag(t *testing.T) {
588+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
589+
defer env.CleanUp()
590+
591+
_ = cli.CopySketch("sketch_simple")
592+
_, _, err := cli.Run("sketch", "archive", "./sketch_simple", "--include-build-dir")
593+
require.NoError(t, err)
594+
595+
archive, err := zip.OpenReader(cli.WorkingDir().Join("sketch_simple.zip").String())
596+
require.NoError(t, err)
597+
defer require.NoError(t, archive.Close())
598+
verifyZipContainsSketchIncludingBuildDir(t, archive.File)
599+
}

test/test_sketch.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ def verify_zip_contains_sketch_including_build_dir(files):
4848
assert "sketch_simple/build/arduino.avr.uno/sketch_simple.ino.with_bootloader.hex" in files
4949

5050

51-
def test_sketch_archive_relative_sketch_path_with_include_build_dir_flag(run_command, copy_sketch, working_dir):
52-
copy_sketch("sketch_simple")
53-
result = run_command(["sketch", "archive", "./sketch_simple", "--include-build-dir"])
54-
assert result.ok
55-
56-
archive = zipfile.ZipFile(f"{working_dir}/sketch_simple.zip")
57-
archive_files = archive.namelist()
58-
59-
verify_zip_contains_sketch_including_build_dir(archive_files)
60-
61-
archive.close()
62-
63-
6451
def test_sketch_archive_absolute_sketch_path_with_include_build_dir_flag(run_command, copy_sketch, working_dir):
6552
result = run_command(
6653
["sketch", "archive", f"{working_dir}/sketch_simple", "--include-build-dir"], copy_sketch("sketch_simple")

0 commit comments

Comments
 (0)