[MM-57295] Bulk export: add roles and permission schemes (#26523)
* Bulk export: add roles and permission schemes * Update mmctl docs * Fix log * Update mmctl tests * Update mmctl unit tests * Refactor to avoid extra calls * Update translations * Add test case * Fix test * Fix test
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c7da6b4741
Коммит
4d6602aff0
@@ -19,7 +19,10 @@ func (s *MmctlUnitTestSuite) TestExportCreateCmdF() {
|
||||
printer.Clean()
|
||||
mockJob := &model.Job{
|
||||
Type: model.JobTypeExportProcess,
|
||||
Data: map[string]string{"include_attachments": "true"},
|
||||
Data: map[string]string{
|
||||
"include_attachments": "true",
|
||||
"include_roles_and_schemes": "true",
|
||||
},
|
||||
}
|
||||
|
||||
s.client.
|
||||
@@ -39,7 +42,9 @@ func (s *MmctlUnitTestSuite) TestExportCreateCmdF() {
|
||||
printer.Clean()
|
||||
mockJob := &model.Job{
|
||||
Type: model.JobTypeExportProcess,
|
||||
Data: make(map[string]string),
|
||||
Data: map[string]string{
|
||||
"include_roles_and_schemes": "true",
|
||||
},
|
||||
}
|
||||
|
||||
s.client.
|
||||
@@ -57,6 +62,31 @@ func (s *MmctlUnitTestSuite) TestExportCreateCmdF() {
|
||||
s.Empty(printer.GetErrorLines())
|
||||
s.Equal(mockJob, printer.GetLines()[0].(*model.Job))
|
||||
})
|
||||
|
||||
s.Run("create export without roles and schemes", func() {
|
||||
printer.Clean()
|
||||
mockJob := &model.Job{
|
||||
Type: model.JobTypeExportProcess,
|
||||
Data: map[string]string{
|
||||
"include_attachments": "true",
|
||||
},
|
||||
}
|
||||
|
||||
s.client.
|
||||
EXPECT().
|
||||
CreateJob(context.TODO(), mockJob).
|
||||
Return(mockJob, &model.Response{}, nil).
|
||||
Times(1)
|
||||
|
||||
cmd := &cobra.Command{}
|
||||
cmd.Flags().Bool("no-roles-and-schemes", true, "")
|
||||
|
||||
err := exportCreateCmdF(s.client, cmd, nil)
|
||||
s.Require().Nil(err)
|
||||
s.Len(printer.GetLines(), 1)
|
||||
s.Empty(printer.GetErrorLines())
|
||||
s.Equal(mockJob, printer.GetLines()[0].(*model.Job))
|
||||
})
|
||||
}
|
||||
|
||||
func (s *MmctlUnitTestSuite) TestExportDeleteCmdF() {
|
||||
|
||||
Ссылка в новой задаче
Block a user