Skip to content

Commit 18c4706

Browse files
Migrate TestCoreIndexWithoutChecksum from test_core.py to core_test.go
1 parent 32d7ac6 commit 18c4706

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
@@ -851,3 +851,19 @@ func TestCoreLoadingPackageManager(t *testing.T) {
851851
_, _, err := cli.Run("core", "list", "--all", "--format", "json")
852852
require.NoError(t, err) // this should not make the cli crash
853853
}
854+
855+
func TestCoreIndexWithoutChecksum(t *testing.T) {
856+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
857+
defer env.CleanUp()
858+
859+
_, _, err := cli.Run("config", "init", "--dest-dir", ".")
860+
require.NoError(t, err)
861+
url := "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/ae5938af2f485910729e7d27aa233032a1cb4734/package_gd32_index.json" // noqa: E501
862+
_, _, err = cli.Run("config", "add", "board_manager.additional_urls", url)
863+
require.NoError(t, err)
864+
865+
_, _, err = cli.Run("core", "update-index")
866+
require.NoError(t, err)
867+
_, _, err = cli.Run("core", "list", "--all")
868+
require.NoError(t, err) // this should not make the cli crash
869+
}

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)