repo_test.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package models_test
  2. import (
  3. . "github.com/gogits/gogs/models"
  4. . "github.com/smartystreets/goconvey/convey"
  5. "testing"
  6. "github.com/gogits/gogs/modules/markdown"
  7. )
  8. func TestRepo(t *testing.T) {
  9. Convey("The metas map", t, func() {
  10. var repo = new(Repository)
  11. repo.Name = "testrepo"
  12. repo.Owner = new(User)
  13. repo.Owner.Name = "testuser"
  14. repo.ExternalTrackerFormat = "https://someurl.com/{user}/{repo}/{issue}"
  15. Convey("When no external tracker is configured", func() {
  16. Convey("It should be nil", func() {
  17. repo.EnableExternalTracker = false
  18. So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil))
  19. })
  20. Convey("It should be nil even if other settings are present", func() {
  21. repo.EnableExternalTracker = false
  22. repo.ExternalTrackerFormat = "http://someurl.com/{user}/{repo}/{issue}"
  23. repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
  24. So(repo.ComposeMetas(), ShouldEqual, map[string]string(nil))
  25. })
  26. })
  27. Convey("When an external issue tracker is configured", func() {
  28. repo.EnableExternalTracker = true
  29. Convey("It should default to numeric issue style", func() {
  30. metas := repo.ComposeMetas()
  31. So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
  32. })
  33. Convey("It should pass through numeric issue style setting", func() {
  34. repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_NUMERIC
  35. metas := repo.ComposeMetas()
  36. So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_NUMERIC)
  37. })
  38. Convey("It should pass through alphanumeric issue style setting", func() {
  39. repo.ExternalTrackerStyle = markdown.ISSUE_NAME_STYLE_ALPHANUMERIC
  40. metas := repo.ComposeMetas()
  41. So(metas["style"], ShouldEqual, markdown.ISSUE_NAME_STYLE_ALPHANUMERIC)
  42. })
  43. Convey("It should contain the user name", func() {
  44. metas := repo.ComposeMetas()
  45. So(metas["user"], ShouldEqual, "testuser")
  46. })
  47. Convey("It should contain the repo name", func() {
  48. metas := repo.ComposeMetas()
  49. So(metas["repo"], ShouldEqual, "testrepo")
  50. })
  51. Convey("It should contain the URL format", func() {
  52. metas := repo.ComposeMetas()
  53. So(metas["format"], ShouldEqual, "https://someurl.com/{user}/{repo}/{issue}")
  54. })
  55. })
  56. })
  57. }
PANIC: session(release): write data/sessions/e/4/e4a9c98e34dd99ba: no space left on device

PANIC

session(release): write data/sessions/e/4/e4a9c98e34dd99ba: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)