Skip to content

Commit 610eda2

Browse files
committed
Added test files withing package without any tests
1 parent 6ff26a9 commit 610eda2

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

pkg/api/api_test.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package api
2+
3+
import (
4+
"testing"
5+
6+
. "github.com/smartystreets/goconvey/convey"
7+
)
8+
9+
func TestNewScalewayAPI(t *testing.T) {
10+
Convey("Testing NewScalewayAPI()", t, func() {
11+
api, err := NewScalewayAPI("http://api-endpoint.com", "http://account-endpoint.com", "my-organization", "my-token")
12+
So(err, ShouldBeNil)
13+
So(api, ShouldNotBeNil)
14+
So(api.ComputeAPI, ShouldEqual, "http://api-endpoint.com")
15+
So(api.AccountAPI, ShouldEqual, "http://account-endpoint.com")
16+
So(api.Token, ShouldEqual, "my-token")
17+
So(api.Organization, ShouldEqual, "my-organization")
18+
So(api.Cache, ShouldNotBeNil)
19+
So(api.client, ShouldNotBeNil)
20+
So(api.anonuuid, ShouldNotBeNil)
21+
})
22+
}

pkg/cli/command_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cli
2+
3+
import (
4+
"testing"
5+
6+
. "github.com/smartystreets/goconvey/convey"
7+
)
8+
9+
func TestCommand_Name(t *testing.T) {
10+
Convey("Testing Command.Name()", t, func() {
11+
command := Command{
12+
UsageLine: "top [OPTIONS] SERVER",
13+
}
14+
So(command.Name(), ShouldEqual, "top")
15+
16+
command = Command{
17+
UsageLine: "top",
18+
}
19+
So(command.Name(), ShouldEqual, "top")
20+
})
21+
}

0 commit comments

Comments
 (0)