]> source.dussan.org Git - gitea.git/commitdiff
add go functest
authorskyblue <ssx205@gmail.com>
Mon, 31 Mar 2014 08:24:58 +0000 (16:24 +0800)
committerskyblue <ssx205@gmail.com>
Mon, 31 Mar 2014 08:24:58 +0000 (16:24 +0800)
tests/.travel.yml
tests/README.md
tests/default_test.go [new file with mode: 0644]
tests/pyquick/test_index_rest.py [deleted file]

index 820621b28313770424b94dbab8bc91437b897763..09a5752bfbf0a9ebc7f8e074f1f3d3d8b5d4bd5b 100644 (file)
@@ -1,5 +1,5 @@
-command: python -m pytest {}
-include: ^test_.*\.py$
+command: go test -v {}
+include: ^.+_test\.go$
 path: ./
 depth: 1
 verbose: true
index aba7d388e5e5e2620a9c9b9acddff98aa45158fa..98693257f2e4e7a3f42f00befef3711cb4983cec 100644 (file)
@@ -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 (file)
index 0000000..d6f3a03
--- /dev/null
@@ -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 (file)
index be0bf18..0000000
+++ /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
-