Crow/test.py

9 lines
563 B
Python
Raw Normal View History

import urllib
2014-04-01 13:58:52 +00:00
assert "Hello World!" == urllib.urlopen('http://localhost:8080').read()
assert "About Flask example." == urllib.urlopen('http://localhost:8080/about').read()
2014-04-01 14:02:03 +00:00
assert 404 == urllib.urlopen('http://localhost:8080/list').getcode()
2014-04-14 15:31:51 +00:00
assert "3 bottles of beer!" == urllib.urlopen('http://localhost:8080/hello/3').read()
assert "100 bottles of beer!" == urllib.urlopen('http://localhost:8080/hello/100').read()
assert "" == urllib.urlopen('http://localhost:8080/hello/500').read()
assert 400 == urllib.urlopen('http://localhost:8080/hello/500').getcode()