Browse Source

Fix test ordering (#14543)

pull/14523/head^2
Chris S. Kim 2 years ago committed by GitHub
parent
commit
7370f0a953
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      command/peering/list/list_test.go

30
command/peering/list/list_test.go

@ -65,6 +65,21 @@ func TestListCommand(t *testing.T) {
require.Contains(t, output, "no peering connections")
})
t.Run("no results - json", func(t *testing.T) {
ui := cli.NewMockUi()
cmd := New(ui)
args := []string{
"-http-addr=" + acceptor.HTTPAddr(),
"-format=json",
}
code := cmd.Run(args)
require.Equal(t, 0, code)
output := ui.OutputWriter.String()
require.Contains(t, output, "[]")
})
t.Run("two results for pretty print", func(t *testing.T) {
generateReq := api.PeeringGenerateTokenRequest{PeerName: "foo"}
@ -94,21 +109,6 @@ func TestListCommand(t *testing.T) {
require.Contains(t, lines[2], "foo")
})
t.Run("no results - json", func(t *testing.T) {
ui := cli.NewMockUi()
cmd := New(ui)
args := []string{
"-http-addr=" + acceptor.HTTPAddr(),
"-format=json",
}
code := cmd.Run(args)
require.Equal(t, 0, code)
output := ui.OutputWriter.String()
require.Contains(t, output, "[]")
})
t.Run("two results for JSON print", func(t *testing.T) {
ui := cli.NewMockUi()

Loading…
Cancel
Save