aboutsummaryrefslogtreecommitdiffstats
path: root/test.py
diff options
context:
space:
mode:
authoripknHama <ipknhama@gmail.com>2014-08-07 01:18:33 +0900
committeripknHama <ipknhama@gmail.com>2014-08-07 01:18:33 +0900
commit031615ac866cc3c8f1900dd4b4aae2106ad31230 (patch)
treeb8b7206ffbd2043368580ec269c97436929fe452 /test.py
parenta0c93f5b84cc11b30bc6320ac26127832ef8bf7a (diff)
downloadcrow-031615ac866cc3c8f1900dd4b4aae2106ad31230.tar.gz
crow-031615ac866cc3c8f1900dd4b4aae2106ad31230.zip
source resturcturing + CMake
Diffstat (limited to 'test.py')
-rw-r--r--test.py28
1 files changed, 0 insertions, 28 deletions
diff --git a/test.py b/test.py
deleted file mode 100644
index e2bf651..0000000
--- a/test.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import urllib
-assert "Hello World!" == urllib.urlopen('http://localhost:18080').read()
-assert "About Crow example." == urllib.urlopen('http://localhost:18080/about').read()
-assert 404 == urllib.urlopen('http://localhost:18080/list').getcode()
-assert "3 bottles of beer!" == urllib.urlopen('http://localhost:18080/hello/3').read()
-assert "100 bottles of beer!" == urllib.urlopen('http://localhost:18080/hello/100').read()
-assert 400 == urllib.urlopen('http://localhost:18080/hello/500').getcode()
-assert "3" == urllib.urlopen('http://localhost:18080/add_json', data='{"a":1,"b":2}').read()
-assert "3" == urllib.urlopen('http://localhost:18080/add/1/2').read()
-
-# test persistent connection
-import socket
-import time
-s = socket.socket()
-s.connect(('localhost', 18080))
-for i in xrange(10):
- s.send('''GET / HTTP/1.1
-Host: localhost\r\n\r\n''');
- assert 'Hello World!' in s.recv(1024)
-
-# test timeout
-s = socket.socket()
-s.connect(('localhost', 18080))
-print 'ERROR REQUEST'
-s.send('''GET / HTTP/1.1
-hHhHHefhwjkefhklwejfklwejf
-''')
-print s.recv(1024)