avatar_test.go 666 B

1234567891011121314151617181920212223242526
  1. // Copyright 2015 - Present, The Gogs Authors. All rights reserved.
  2. // Copyright 2018 - Present, Gitote. All rights reserved.
  3. //
  4. // This source code is licensed under the MIT license found in the
  5. // LICENSE file in the root directory of this source tree.
  6. package avatar
  7. import (
  8. "testing"
  9. . "github.com/smartystreets/goconvey/convey"
  10. )
  11. func Test_RandomImage(t *testing.T) {
  12. Convey("Generate a random avatar from email", t, func() {
  13. _, err := RandomImage([]byte("gitote@local"))
  14. So(err, ShouldBeNil)
  15. Convey("Try to generate an image with size zero", func() {
  16. _, err := RandomImageSize(0, []byte("gitote@local"))
  17. So(err, ShouldNotBeNil)
  18. })
  19. })
  20. }