Skip to content

Commit 2bf5bc6

Browse files
Migrate TestUpdate from test_update.py to update_test.go
1 parent f0479ba commit 2bf5bc6

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright 2022 ARDUINO SA (http://www.arduino.cc/)
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to license@arduino.cc.
15+
16+
package update_test
17+
18+
import (
19+
"testing"
20+
21+
"github.com/arduino/arduino-cli/internal/integrationtest"
22+
"github.com/stretchr/testify/require"
23+
)
24+
25+
func TestUpdate(t *testing.T) {
26+
env, cli := integrationtest.CreateArduinoCLIWithEnvironment(t)
27+
defer env.CleanUp()
28+
29+
stdout, _, err := cli.Run("update")
30+
require.NoError(t, err)
31+
require.Contains(t, string(stdout), "Downloading index: package_index.tar.bz2 downloaded")
32+
require.Contains(t, string(stdout), "Downloading index: library_index.tar.bz2 downloaded")
33+
}

test/test_update.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@
1616
from pathlib import Path
1717

1818

19-
def test_update(run_command):
20-
res = run_command(["update"])
21-
assert res.ok
22-
lines = [l.strip() for l in res.stdout.splitlines()]
23-
24-
assert "Downloading index: package_index.tar.bz2 downloaded" in lines
25-
assert "Downloading index: library_index.tar.bz2 downloaded" in lines
26-
27-
2819
def test_update_showing_outdated(run_command):
2920
# Updates index for cores and libraries
3021
run_command(["core", "update-index"])

0 commit comments

Comments
 (0)