diff options
author | skyblue <ssx205@gmail.com> | 2014-03-31 16:24:58 +0800 |
---|---|---|
committer | skyblue <ssx205@gmail.com> | 2014-03-31 16:24:58 +0800 |
commit | 9acc1c33be76b05231ec3a5a222af02484689974 (patch) | |
tree | 80d3ecab43506e03405c742a84dcc61f474e2212 /tests | |
parent | 587e6d80890f9e679b13a1511dab6635fd520775 (diff) | |
download | gitea-9acc1c33be76b05231ec3a5a222af02484689974.tar.gz gitea-9acc1c33be76b05231ec3a5a222af02484689974.zip |
add go functest
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.travel.yml | 4 | ||||
-rw-r--r-- | tests/README.md | 3 | ||||
-rw-r--r-- | tests/default_test.go | 17 | ||||
-rw-r--r-- | tests/pyquick/test_index_rest.py | 13 |
4 files changed, 19 insertions, 18 deletions
diff --git a/tests/.travel.yml b/tests/.travel.yml index 820621b283..09a5752bfb 100644 --- a/tests/.travel.yml +++ b/tests/.travel.yml @@ -1,5 +1,5 @@ -command: python -m pytest {} -include: ^test_.*\.py$ +command: go test -v {} +include: ^.+_test\.go$ path: ./ depth: 1 verbose: true diff --git a/tests/README.md b/tests/README.md index aba7d388e5..98693257f2 100644 --- a/tests/README.md +++ b/tests/README.md @@ -3,9 +3,6 @@ this is for developers ## prepare environment - # install python dependency - pip install pytest - # install basic test tool go get -u github.com/shxsun/travelexec # start gogs server gogs web diff --git a/tests/default_test.go b/tests/default_test.go new file mode 100644 index 0000000000..d6f3a03be6 --- /dev/null +++ b/tests/default_test.go @@ -0,0 +1,17 @@ +package test + +import ( + "net/http" + "testing" +) + +func TestMain(t *testing.T) { + r, err := http.Get("http://localhost:3000/") + if err != nil { + t.Fatal(err) + } + defer r.Body.Close() + if r.StatusCode != http.StatusOK { + t.Error(r.StatusCode) + } +} diff --git a/tests/pyquick/test_index_rest.py b/tests/pyquick/test_index_rest.py deleted file mode 100644 index be0bf18300..0000000000 --- a/tests/pyquick/test_index_rest.py +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python -# coding: utf-8 -# -# - -import requests - -HOST = 'http://localhost:3000' - -def test_index_get(): - r = requests.get(HOST + '/') - assert r.status_code == 200 - |