2
# Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
4
# Permission is hereby granted, free of charge, to any person obtaining a
5
# copy of this software and associated documentation files (the
6
# "Software"), to deal in the Software without restriction, including
7
# without limitation the rights to use, copy, modify, merge, publish, dis-
8
# tribute, sublicense, and/or sell copies of the Software, and to permit
9
# persons to whom the Software is furnished to do so, subject to the fol-
12
# The above copyright notice and this permission notice shall be included
13
# in all copies or substantial portions of the Software.
15
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
17
# ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
18
# SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
import sys, os, unittest
31
from boto.tests.test_sqsconnection import SQSConnectionTest
32
from boto.tests.test_s3connection import S3ConnectionTest
33
from boto.tests.test_s3versioning import S3VersionTest
34
from boto.tests.test_ec2connection import EC2ConnectionTest
35
from boto.tests.test_sdbconnection import SDBConnectionTest
38
print 'test.py [-t testsuite] [-v verbosity]'
39
print ' -t run specific testsuite (s3|sqs|ec2|sdb|all)'
40
print ' -v verbosity (0|1|2)'
44
opts, args = getopt.getopt(sys.argv[1:], 'ht:v:',
45
['help', 'testsuite', 'verbosity'])
52
if o in ('-h', '--help'):
55
if o in ('-t', '--testsuite'):
57
if o in ('-v', '--verbosity'):
62
suite = unittest.TestSuite()
63
if testsuite == 'all':
64
suite.addTest(unittest.makeSuite(SQSConnectionTest))
65
suite.addTest(unittest.makeSuite(S3ConnectionTest))
66
suite.addTest(unittest.makeSuite(EC2ConnectionTest))
67
suite.addTest(unittest.makeSuite(SDBConnectionTest))
68
elif testsuite == 's3':
69
suite.addTest(unittest.makeSuite(S3ConnectionTest))
70
suite.addTest(unittest.makeSuite(S3VersionTest))
71
elif testsuite == 's3ver':
72
suite.addTest(unittest.makeSuite(S3VersionTest))
73
elif testsuite == 'sqs':
74
suite.addTest(unittest.makeSuite(SQSConnectionTest))
75
elif testsuite == 'ec2':
76
suite.addTest(unittest.makeSuite(EC2ConnectionTest))
77
elif testsuite == 'sdb':
78
suite.addTest(unittest.makeSuite(SDBConnectionTest))
82
unittest.TextTestRunner(verbosity=verbosity).run(suite)
84
if __name__ == "__main__":