]> source.dussan.org Git - gitea.git/commitdiff
add tests
authorskyblue <ssx205@gmail.com>
Mon, 31 Mar 2014 05:30:32 +0000 (13:30 +0800)
committerskyblue <ssx205@gmail.com>
Mon, 31 Mar 2014 05:30:32 +0000 (13:30 +0800)
.gitignore
tests/.travel.yml [new file with mode: 0644]
tests/README.md [new file with mode: 0644]
tests/pyquick/test_index_rest.py [new file with mode: 0644]

index cd9109b8db0c8a4c88e2388fc0446cff660f7616..158421d04a9f776f78956592e480bbd0d555dec4 100644 (file)
@@ -1,9 +1,3 @@
-<<<<<<< HEAD
-
-
-gogs
-*.exe
-*.exe~
 .DS_Store
 *.db
 *.log
@@ -14,8 +8,6 @@ data/
 *.iml
 public/img/avatar/
 
-=======
->>>>>>> b4db9f67548a41922f1b337daf9c9d2b975b55c4
 # Compiled Object files, Static and Dynamic libs (Shared Objects)
 *.o
 *.a
@@ -37,4 +29,7 @@ _cgo_export.*
 
 _testmain.go
 
-*.exe
\ No newline at end of file
+*.exe
+*.exe~
+gogs
+__pycache__
diff --git a/tests/.travel.yml b/tests/.travel.yml
new file mode 100644 (file)
index 0000000..820621b
--- /dev/null
@@ -0,0 +1,9 @@
+command: python -m pytest {}
+include: ^test_.*\.py$
+path: ./
+depth: 1
+verbose: true
+timeout: 1m
+reload: false
+html: test.html
+notify: []
diff --git a/tests/README.md b/tests/README.md
new file mode 100644 (file)
index 0000000..aba7d38
--- /dev/null
@@ -0,0 +1,14 @@
+## gogs test
+
+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
+
+## start test
+       travelexec
diff --git a/tests/pyquick/test_index_rest.py b/tests/pyquick/test_index_rest.py
new file mode 100644 (file)
index 0000000..be0bf18
--- /dev/null
@@ -0,0 +1,13 @@
+#!/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
+