-
Notifications
You must be signed in to change notification settings - Fork 8
/
test.py
37 lines (30 loc) · 771 Bytes
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Shorty
# Copyright 2009 Joshua Roesslein
# See LICENSE
import sys
import shorty
print 'Running shorty tests...'
passes = 0
fails = 0
# get services to test
if len(sys.argv) > 1:
try:
services = dict((name, shorty.services[name]) for name in sys.argv[1:])
except KeyError, k:
print 'ERROR: %s not valid service' % k
exit(1)
else:
services = shorty.services
# run tests
for name, service in services.items():
try:
if service.tested:
# skip services with aliases
continue
service._test()
passes += 1
print 'PASS: <%s>' % name
except shorty.ShortyError, e:
fails += 1
print 'FAIL: <%s> %s' % (name, e)
print 'PASSES: %i FAILS: %i' % (passes, fails)