diff options
author | zhsso <zhssoge@gmail.com> | 2014-04-10 14:20:01 -0400 |
---|---|---|
committer | zhsso <zhssoge@gmail.com> | 2014-04-10 14:20:01 -0400 |
commit | f3ed11d177d76bcb1850c6670c1516d25a66eb2c (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /modules/avatar/avatar_test.go | |
parent | fde5b16332d5c4dc8246b899cd42d58b058f2bed (diff) |
mistakes
Diffstat (limited to 'modules/avatar/avatar_test.go')
-rw-r--r-- | modules/avatar/avatar_test.go | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/modules/avatar/avatar_test.go b/modules/avatar/avatar_test.go deleted file mode 100644 index 0cbf70fe..00000000 --- a/modules/avatar/avatar_test.go +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2014 The Gogs Authors. All rights reserved. -// Use of this source code is governed by a MIT-style -// license that can be found in the LICENSE file. -package avatar_test - -import ( - "errors" - "os" - "strconv" - "testing" - "time" - - "github.com/gogits/gogs/modules/avatar" - "github.com/gogits/gogs/modules/log" -) - -const TMPDIR = "test-avatar" - -func TestFetch(t *testing.T) { - os.Mkdir(TMPDIR, 0755) - defer os.RemoveAll(TMPDIR) - - hash := avatar.HashEmail("ssx205@gmail.com") - a := avatar.New(hash, TMPDIR) - a.UpdateTimeout(time.Millisecond * 200) -} - -func TestFetchMany(t *testing.T) { - os.Mkdir(TMPDIR, 0755) - defer os.RemoveAll(TMPDIR) - - t.Log("start") - var n = 5 - ch := make(chan bool, n) - for i := 0; i < n; i++ { - go func(i int) { - hash := avatar.HashEmail(strconv.Itoa(i) + "ssx205@gmail.com") - a := avatar.New(hash, TMPDIR) - a.Update() - t.Log("finish", hash) - ch <- true - }(i) - } - for i := 0; i < n; i++ { - <-ch - } - t.Log("end") -} - -// cat -// wget http://www.artsjournal.com/artfulmanager/wp/wp-content/uploads/2013/12/200x200xmirror_cat.jpg.pagespeed.ic.GOZSv6v1_H.jpg -O default.jpg -/* -func TestHttp(t *testing.T) { - http.Handle("/", avatar.CacheServer("./", "default.jpg")) - http.ListenAndServe(":8001", nil) -} -*/ - -func TestLogTrace(t *testing.T) { - log.Trace("%v", errors.New("console log test")) -} |