airshipctl/cmd/document/pull_test.go
Ruslan Aliev 79555848f2 Fix document pull unit test in cmd
TestPull unit test should not perform functional verification. The purpose of
cmd unit tests should be testing proper cmd object creation, not actually run
the command. Moreover, we don't have possibility to mock and track all the
objects that created inside of called functions. We can only verify golden output
with help or when command performs basic stuff just inside of RunE interface. Actual
test of called methods performed in pkg module.

Change-Id: I2ad6b76f67cbf59d798c0f2b93752b3e3b3b053d
Signed-off-by: Ruslan Aliev <raliev@mirantis.com>
2020-08-03 23:29:10 -05:00

36 lines
863 B
Go

/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package document
import (
"testing"
"opendev.org/airship/airshipctl/testutil"
)
func TestPull(t *testing.T) {
cmdTests := []*testutil.CmdTest{
{
Name: "document-pull-cmd-with-help",
CmdLine: "--help",
Cmd: NewPullCommand(nil),
},
}
for _, tt := range cmdTests {
testutil.RunTest(t, tt)
}
}