Skip to content

Commit 8d7a3ee

Browse files
Migrate TestSketchArchiveAbsoluteSketchPathWithRelativeZipPathAndNameWithExtension from test_sketch.py to sketch_test.go
1 parent 653737b commit 8d7a3ee

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

internal/integrationtest/sketch/sketch_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,21 @@ func TestSketchArchiveAbsoluteSketchPathWithRelativeZipPathAndNameWithoutExtensi
387387
defer require.NoError(t, archive.Close())
388388
verifyZipContainsSketchExcludingBuildDir(t, archive.File)
389389
}
390+
391+
func TestSketchArchiveAbsoluteSketchPathWithRelativeZipPathAndNameWithExtension(t *testing.T) {
392+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
393+
defer env.CleanUp()
394+
395+
_ = cli.CopySketch("sketch_simple")
396+
// Creates a folder where to save the zip
397+
archivesFolder := cli.WorkingDir().Join("my_archives")
398+
require.NoError(t, archivesFolder.Mkdir())
399+
400+
_, _, err := cli.Run("sketch", "archive", cli.WorkingDir().Join("sketch_simple").String(), "./my_archives/my_custom_sketch.zip")
401+
require.NoError(t, err)
402+
403+
archive, err := zip.OpenReader(cli.WorkingDir().Join("my_archives", "my_custom_sketch.zip").String())
404+
require.NoError(t, err)
405+
defer require.NoError(t, archive.Close())
406+
verifyZipContainsSketchExcludingBuildDir(t, archive.File)
407+
}

test/test_sketch.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +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_absolute_sketch_path_with_relative_zip_path_and_name_with_extension(
52-
run_command, copy_sketch, working_dir
53-
):
54-
copy_sketch("sketch_simple")
55-
# Creates a folder where to save the zip
56-
archives_folder = f"{working_dir}/my_archives/"
57-
Path(archives_folder).mkdir()
58-
59-
result = run_command(["sketch", "archive", f"{working_dir}/sketch_simple", "./my_archives/my_custom_sketch.zip"])
60-
assert result.ok
61-
62-
archive = zipfile.ZipFile(f"{working_dir}/my_archives/my_custom_sketch.zip")
63-
archive_files = archive.namelist()
64-
65-
verify_zip_contains_sketch_excluding_build_dir(archive_files)
66-
67-
archive.close()
68-
69-
7051
def test_sketch_archive_absolute_sketch_path_with_absolute_zip_path_and_name_without_extension(
7152
run_command, copy_sketch, working_dir
7253
):

0 commit comments

Comments
 (0)