| 92 | } |
| 93 | |
| 94 | func (s *testSuite) TestExists() { |
| 95 | s.T().Run("doesn't exist", func(t *testing.T) { |
| 96 | found, err := s.backend.Exists(context.Background(), "aabbccddeeff") |
| 97 | s.NoError(err) |
| 98 | s.False(found) |
| 99 | }) |
| 100 | |
| 101 | s.T().Run("found", func(t *testing.T) { |
| 102 | found, err := s.backend.Exists(context.Background(), s.ownedObjectDigest) |
| 103 | s.NoError(err) |
| 104 | s.True(found) |
| 105 | }) |
| 106 | |
| 107 | s.T().Run("exists but not uploaded by chainloop", func(t *testing.T) { |
| 108 | found, err := s.backend.Exists(context.Background(), s.externalObjectDigest) |
| 109 | s.ErrorContains(err, "not uploaded by Chainloop") |
| 110 | s.False(found) |
| 111 | }) |
| 112 | } |
| 113 | |
| 114 | func (s *testSuite) TestDescribe() { |
| 115 | s.T().Run("doesn't exist", func(t *testing.T) { |