Skip to content

Commit d7c54d0

Browse files
Migrate TestCoreIndexWithoutChecksum from test_core.py to core_test.go
1 parent 0fc96a1 commit d7c54d0

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

internal/integrationtest/core/core_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -866,3 +866,19 @@ func TestCoreLoadingPackageManager(t *testing.T) {
866866
_, _, err := cli.Run("core", "list", "--all", "--format", "json")
867867
require.NoError(t, err) // this should not make the cli crash
868868
}
869+
870+
func TestCoreIndexWithoutChecksum(t *testing.T) {
871+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
872+
defer env.CleanUp()
873+
874+
_, _, err := cli.Run("config", "init", "--dest-dir", ".")
875+
require.NoError(t, err)
876+
url := "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/ae5938af2f485910729e7d27aa233032a1cb4734/package_gd32_index.json" // noqa: E501
877+
_, _, err = cli.Run("config", "add", "board_manager.additional_urls", url)
878+
require.NoError(t, err)
879+
880+
_, _, err = cli.Run("core", "update-index")
881+
require.NoError(t, err)
882+
_, _, err = cli.Run("core", "list", "--all")
883+
require.NoError(t, err) // this should not make the cli crash
884+
}

test/test_core.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,4 @@ def test_core_download_multiple_platforms(run_command, data_dir):
130130
# The cli should not allow it since optimizing the casing results in finding two cores
131131
res = run_command(["core", "upgrade", "Packager:Arch"])
132132
assert res.failed
133-
assert "Invalid argument passed: Found 2 platform for reference" in res.stderr
134-
135-
136-
def test_core_index_without_checksum(run_command):
137-
assert run_command(["config", "init", "--dest-dir", "."])
138-
url = "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/ae5938af2f485910729e7d27aa233032a1cb4734/package_gd32_index.json" # noqa: E501
139-
assert run_command(["config", "add", "board_manager.additional_urls", url])
140-
141-
assert run_command(["core", "update-index"])
142-
result = run_command(["core", "list", "--all"])
143-
assert result.ok # this should not make the cli crash
133+
assert "Invalid argument passed: Found 2 platform for reference" in res.stderr

0 commit comments

Comments
 (0)