@@ -392,7 +392,6 @@ func TestChartRepository_CacheIndex(t *testing.T) {
392
392
r := newChartRepository ()
393
393
r .URL = "https://example.com"
394
394
r .Client = & mg
395
- r .revisions ["key" ] = "value"
396
395
r .digests ["key" ] = "value"
397
396
398
397
err := r .CacheIndex ()
@@ -405,7 +404,6 @@ func TestChartRepository_CacheIndex(t *testing.T) {
405
404
b , _ := os .ReadFile (r .Path )
406
405
g .Expect (b ).To (Equal (mg .Response ))
407
406
408
- g .Expect (r .revisions ).To (BeEmpty ())
409
407
g .Expect (r .digests ).To (BeEmpty ())
410
408
}
411
409
@@ -480,11 +478,9 @@ func TestChartRepository_LoadFromPath(t *testing.T) {
480
478
481
479
r := newChartRepository ()
482
480
r .Path = i
483
- r .revisions ["key" ] = "value"
484
481
485
482
g .Expect (r .LoadFromPath ()).To (Succeed ())
486
483
g .Expect (r .Index ).ToNot (BeNil ())
487
- g .Expect (r .revisions ).To (BeEmpty ())
488
484
})
489
485
490
486
t .Run ("no cache path" , func (t * testing.T ) {
@@ -507,44 +503,6 @@ func TestChartRepository_LoadFromPath(t *testing.T) {
507
503
})
508
504
}
509
505
510
- func TestChartRepository_Revision (t * testing.T ) {
511
- t .Run ("with algorithm" , func (t * testing.T ) {
512
- r := newChartRepository ()
513
- r .Index = repo .NewIndexFile ()
514
-
515
- for _ , algo := range []digest.Algorithm {digest .SHA256 , digest .SHA512 } {
516
- t .Run (algo .String (), func (t * testing.T ) {
517
- g := NewWithT (t )
518
-
519
- d := r .Revision (algo )
520
- g .Expect (d ).ToNot (BeEmpty ())
521
- g .Expect (d .Algorithm ()).To (Equal (algo ))
522
- g .Expect (r .revisions [algo ]).To (Equal (d ))
523
- })
524
- }
525
- })
526
-
527
- t .Run ("without index" , func (t * testing.T ) {
528
- g := NewWithT (t )
529
-
530
- r := newChartRepository ()
531
- g .Expect (r .Revision (digest .SHA256 )).To (BeEmpty ())
532
- })
533
-
534
- t .Run ("from cache" , func (t * testing.T ) {
535
- g := NewWithT (t )
536
-
537
- algo := digest .SHA256
538
- expect := digest .Digest ("sha256:fake" )
539
-
540
- r := newChartRepository ()
541
- r .Index = repo .NewIndexFile ()
542
- r .revisions [algo ] = expect
543
-
544
- g .Expect (r .Revision (algo )).To (Equal (expect ))
545
- })
546
- }
547
-
548
506
func TestChartRepository_Digest (t * testing.T ) {
549
507
t .Run ("with algorithm" , func (t * testing.T ) {
550
508
g := NewWithT (t )
@@ -625,11 +583,9 @@ func TestChartRepository_Clear(t *testing.T) {
625
583
626
584
r := newChartRepository ()
627
585
r .Index = repo .NewIndexFile ()
628
- r .revisions ["key" ] = "value"
629
586
630
587
g .Expect (r .Clear ()).To (Succeed ())
631
588
g .Expect (r .Index ).To (BeNil ())
632
- g .Expect (r .revisions ).To (BeEmpty ())
633
589
})
634
590
635
591
t .Run ("with index and cached path" , func (t * testing.T ) {
@@ -643,14 +599,12 @@ func TestChartRepository_Clear(t *testing.T) {
643
599
r .Path = f .Name ()
644
600
r .Index = repo .NewIndexFile ()
645
601
r .digests ["key" ] = "value"
646
- r .revisions ["key" ] = "value"
647
602
r .cached = true
648
603
649
604
g .Expect (r .Clear ()).To (Succeed ())
650
605
g .Expect (r .Index ).To (BeNil ())
651
606
g .Expect (r .Path ).To (BeEmpty ())
652
607
g .Expect (r .digests ).To (BeEmpty ())
653
- g .Expect (r .revisions ).To (BeEmpty ())
654
608
g .Expect (r .cached ).To (BeFalse ())
655
609
})
656
610
@@ -677,11 +631,9 @@ func TestChartRepository_Invalidate(t *testing.T) {
677
631
678
632
r := newChartRepository ()
679
633
r .digests ["key" ] = "value"
680
- r .revisions ["key" ] = "value"
681
634
682
635
r .Invalidate ()
683
636
g .Expect (r .digests ).To (BeEmpty ())
684
- g .Expect (r .revisions ).To (BeEmpty ())
685
637
}
686
638
687
639
func verifyLocalIndex (t * testing.T , i * repo.IndexFile ) {
0 commit comments