Skip to content

Commit

Permalink
add tests for NewBildProcessorWithCompression
Browse files Browse the repository at this point in the history
  • Loading branch information
ajatprabha committed Jul 24, 2019
1 parent 5630aa7 commit d61ae46
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/processor/native/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package native

import (
"image"
"image/png"
"io/ioutil"
"testing"

Expand Down Expand Up @@ -32,6 +33,14 @@ func TestNewBildProcessor(t *testing.T) {
suite.Run(t, new(BildProcessorSuite))
}

func (s *BildProcessorSuite) TestNewBildProcessorWithCompression() {
p := NewBildProcessorWithCompression(&CompressionOptions{JpegQuality: 70, PngCompressionLevel: png.BestSpeed})

assert.NotNil(s.T(), p)
assert.Equal(s.T(), 70, p.encoders.Options().JpegQuality)
assert.Equal(s.T(), png.BestSpeed, p.encoders.Options().PngCompressionLevel)
}

func (s *BildProcessorSuite) TestBildProcessor_Resize() {
out := s.processor.Resize(s.srcImage, 500, 500)

Expand Down

0 comments on commit d61ae46

Please sign in to comment.