github.com/easysoft/zendata@v0.0.0-20240513203326-705bd5a7fd67/cmd/test/command/cmd_data_list_test.go (about) 1 package main 2 3 import ( 4 "testing" 5 6 "github.com/easysoft/zendata/cmd/test/consts" 7 testHelper "github.com/easysoft/zendata/cmd/test/helper" 8 "github.com/easysoft/zendata/internal/pkg/helper" 9 "github.com/ozontech/allure-go/pkg/framework/provider" 10 "github.com/ozontech/allure-go/pkg/framework/suite" 11 ) 12 13 func TestDataListCmd(t *testing.T) { 14 suite.RunSuite(t, new(DataListCmdSuite)) 15 } 16 17 type DataListCmdSuite struct { 18 suite.Suite 19 } 20 21 func (s *DataListCmdSuite) BeforeAll(t provider.T) { 22 testHelper.BeforeAll() 23 t.AddSubSuite("DataListCmd") 24 } 25 func (s *DataListCmdSuite) BeforeEach(t provider.T) { 26 testHelper.PreCase() 27 28 t.AddSubSuite("DataListCmd") 29 } 30 func (s *DataListCmdSuite) AfterEach(t provider.T) { 31 testHelper.PostCase() 32 } 33 34 func (s *DataListCmdSuite) TestDataList(t provider.T) { 35 t.ID("0") 36 37 helper.ListData() 38 39 out := consts.Buf.String() 40 41 t.Require().Contains(out, "test.v1.yaml", "check list content") 42 } 43 44 func (s *DataListCmdSuite) TestResList(t provider.T) { 45 t.ID("0") 46 47 helper.ListRes() 48 49 out := consts.Buf.String() 50 51 t.Require().Contains(out, "city.v1.xlsx", "check list content") 52 }