Skip to content

Commit 0fc96a1

Browse files
Migrate TestCoreLoadingPackageManager from test_core.py to core_test.go
1 parent 7706e93 commit 0fc96a1

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

internal/integrationtest/core/core_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,3 +855,14 @@ func TestCoreListOutdatedCore(t *testing.T) {
855855
// Installed version must be older than latest
856856
require.True(t, installedVersion.LessThan(latestVersion))
857857
}
858+
859+
func TestCoreLoadingPackageManager(t *testing.T) {
860+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
861+
defer env.CleanUp()
862+
863+
// Create empty architecture folder (this condition is normally produced by `core uninstall`)
864+
require.NoError(t, cli.DataDir().Join("packages", "foovendor", "hardware", "fooarch").MkdirAll())
865+
866+
_, _, err := cli.Run("core", "list", "--all", "--format", "json")
867+
require.NoError(t, err) // this should not make the cli crash
868+
}

test/test_core.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,6 @@ def test_core_download_multiple_platforms(run_command, data_dir):
133133
assert "Invalid argument passed: Found 2 platform for reference" in res.stderr
134134

135135

136-
def test_core_loading_package_manager(run_command, data_dir):
137-
# Create empty architecture folder (this condition is normally produced by `core uninstall`)
138-
(Path(data_dir) / "packages" / "foovendor" / "hardware" / "fooarch").mkdir(parents=True)
139-
140-
result = run_command(["core", "list", "--all", "--format", "json"])
141-
assert result.ok # this should not make the cli crash
142-
143-
144136
def test_core_index_without_checksum(run_command):
145137
assert run_command(["config", "init", "--dest-dir", "."])
146138
url = "https://raw.githubusercontent.com/keyboardio/ArduinoCore-GD32-Keyboardio/ae5938af2f485910729e7d27aa233032a1cb4734/package_gd32_index.json" # noqa: E501

0 commit comments

Comments
 (0)