Skip to content

Commit 0489aae

Browse files
Migrated TestHelp from test_main.py to main_test.go
1 parent 513f5a1 commit 0489aae

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 [email protected].
15+
16+
package main_test
17+
18+
import (
19+
"testing"
20+
21+
"github.com/arduino/arduino-cli/internal/integrationtest"
22+
"github.com/arduino/go-paths-helper"
23+
"github.com/stretchr/testify/require"
24+
"go.bug.st/testsuite"
25+
)
26+
27+
func TestHelp(t *testing.T) {
28+
env := testsuite.NewEnvironment(t)
29+
defer env.CleanUp()
30+
31+
cli := integrationtest.NewArduinoCliWithinEnvironment(env, &integrationtest.ArduinoCLIConfig{
32+
ArduinoCLIPath: paths.New("..", "..", "..", "arduino-cli"),
33+
UseSharedStagingFolder: true,
34+
})
35+
36+
// Run help and check the output message
37+
stdout, stderr, err := cli.Run("help")
38+
require.NoError(t, err)
39+
require.Empty(t, stderr)
40+
require.Contains(t, string(stdout), "Usage")
41+
}

test/test_main.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,6 @@
1919
import yaml
2020

2121

22-
def test_help(run_command):
23-
result = run_command(["help"])
24-
assert result.ok
25-
assert result.stderr == ""
26-
assert "Usage" in result.stdout
27-
28-
2922
def test_version(run_command):
3023
result = run_command(["version"])
3124
assert result.ok

0 commit comments

Comments
 (0)