@@ -479,55 +479,3 @@ func TestValidateConfig(t *testing.T) {
479
479
})
480
480
}
481
481
}
482
-
483
- func TestValidateModule (t * testing.T ) {
484
- tests := []struct {
485
- in Module
486
- out error
487
- errPath path.ContextPath
488
- }{
489
- {
490
- // valid module
491
- in : Module {
492
- Contents : Resource {
493
- Inline : util .StrToPtr ("some contents" ),
494
- },
495
- Name : "some name" ,
496
- },
497
- out : nil ,
498
- errPath : path .New ("yaml" ),
499
- },
500
- {
501
- // contents is not specified
502
- in : Module {
503
- Contents : Resource {
504
- Inline : util .StrToPtr ("" ),
505
- },
506
- Name : "some name" ,
507
- },
508
- out : common .ErrSelinuxContentsNotSpecified ,
509
- errPath : path .New ("yaml" , "contents" ),
510
- },
511
- {
512
- // name is not specified
513
- in : Module {
514
- Name : "" ,
515
- Contents : Resource {
516
- Inline : util .StrToPtr ("some contents" ),
517
- },
518
- },
519
- out : common .ErrSelinuxNameNotSpecified ,
520
- errPath : path .New ("yaml" , "name" ),
521
- },
522
- }
523
-
524
- for i , test := range tests {
525
- t .Run (fmt .Sprintf ("validate %d" , i ), func (t * testing.T ) {
526
- actual := test .in .Validate (path .New ("yaml" ))
527
- baseutil .VerifyReport (t , test .in , actual )
528
- expected := report.Report {}
529
- expected .AddOnError (test .errPath , test .out )
530
- assert .Equal (t , expected , actual , "bad report" )
531
- })
532
- }
533
- }
0 commit comments