Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consolidate interface mocks in a testing subpackage #1577

Merged
merged 6 commits into from Jun 14, 2022

Commits on Jun 13, 2022

  1. Rename imagetransport.go to image_transport.go

    to be a bit easier to read, and consistent with future
    changes.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    163c57f View commit details
    Browse the repository at this point in the history
  2. Move image.unusedImageSource to mocks.ForbiddenImageSource

    Start collecting Forbiden* mocks in mocks, to eliminate
    unnecessary duplication.
    
    Should not change (test) behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    38bda3b View commit details
    Browse the repository at this point in the history
  3. Introduce mocks.ForbiddenImageReference, use it to simplify tests

    Should not change (test) behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    94a2667 View commit details
    Browse the repository at this point in the history
  4. Remove irrelevant methods from forbiddenImageMock

    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    5bac997 View commit details
    Browse the repository at this point in the history
  5. Introduce mocks.ForbiddenUnparsedImage, use it to simplify tests

    Should not change (test) behavior.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    6bc5785 View commit details
    Browse the repository at this point in the history
  6. Use a separate fakeUnparsedImage for TestIsMultiImage

    We will need to reimplement the fakeImageSource (actually a types.Image)
    for testing determineManifestConversion differently, so split the two.
    
    Signed-off-by: Miloslav Trmač <mitr@redhat.com>
    mtrmac committed Jun 13, 2022
    Copy the full SHA
    4856cb9 View commit details
    Browse the repository at this point in the history