mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-07-12 23:00:55 +02:00
Fix tests
This commit is contained in:
@ -57,7 +57,8 @@ func (s *ProcessingOptionsTestSuite) TestParseBase64URLInvalid() {
|
|||||||
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/%s.png", base64.RawURLEncoding.EncodeToString([]byte(imageURL))))
|
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/%s.png", base64.RawURLEncoding.EncodeToString([]byte(imageURL))))
|
||||||
_, err := parsePath(context.Background(), req)
|
_, err := parsePath(context.Background(), req)
|
||||||
|
|
||||||
assert.Equal(s.T(), errInvalidImageURL, err)
|
require.Error(s.T(), err)
|
||||||
|
assert.Equal(s.T(), errInvalidImageURL.Error(), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProcessingOptionsTestSuite) TestParsePlainURL() {
|
func (s *ProcessingOptionsTestSuite) TestParsePlainURL() {
|
||||||
@ -119,7 +120,8 @@ func (s *ProcessingOptionsTestSuite) TestParsePlainURLInvalid() {
|
|||||||
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/plain/%s@png", imageURL))
|
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/plain/%s@png", imageURL))
|
||||||
_, err := parsePath(context.Background(), req)
|
_, err := parsePath(context.Background(), req)
|
||||||
|
|
||||||
assert.Equal(s.T(), errInvalidImageURL, err)
|
require.Error(s.T(), err)
|
||||||
|
assert.Equal(s.T(), errInvalidImageURL.Error(), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProcessingOptionsTestSuite) TestParsePlainURLEscapedInvalid() {
|
func (s *ProcessingOptionsTestSuite) TestParsePlainURLEscapedInvalid() {
|
||||||
@ -127,7 +129,8 @@ func (s *ProcessingOptionsTestSuite) TestParsePlainURLEscapedInvalid() {
|
|||||||
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/plain/%s@png", url.PathEscape(imageURL)))
|
req := s.getRequest(fmt.Sprintf("http://example.com/unsafe/size:100:100/plain/%s@png", url.PathEscape(imageURL)))
|
||||||
_, err := parsePath(context.Background(), req)
|
_, err := parsePath(context.Background(), req)
|
||||||
|
|
||||||
assert.Equal(s.T(), errInvalidImageURL, err)
|
require.Error(s.T(), err)
|
||||||
|
assert.Equal(s.T(), errInvalidImageURL.Error(), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *ProcessingOptionsTestSuite) TestParsePathBasic() {
|
func (s *ProcessingOptionsTestSuite) TestParsePathBasic() {
|
||||||
@ -551,7 +554,8 @@ func (s *ProcessingOptionsTestSuite) TestParsePathSignedInvalid() {
|
|||||||
req := s.getRequest("http://example.com/unsafe/width:150/plain/http://images.dev/lorem/ipsum.jpg@png")
|
req := s.getRequest("http://example.com/unsafe/width:150/plain/http://images.dev/lorem/ipsum.jpg@png")
|
||||||
_, err := parsePath(context.Background(), req)
|
_, err := parsePath(context.Background(), req)
|
||||||
|
|
||||||
require.Equal(s.T(), errInvalidToken, err)
|
require.Error(s.T(), err)
|
||||||
|
assert.Equal(s.T(), errInvalidToken.Error(), err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestProcessingOptions(t *testing.T) {
|
func TestProcessingOptions(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user