2
# Copyright (c) 2006-2011 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
32
from sqs.test_connection import SQSConnectionTest
33
from s3.test_connection import S3ConnectionTest
34
from s3.test_versioning import S3VersionTest
35
from s3.test_gsconnection import GSConnectionTest
36
from s3.test_https_cert_validation import CertValidationTest
37
from ec2.test_connection import EC2ConnectionTest
38
from autoscale.test_connection import AutoscaleConnectionTest
39
from sdb.test_connection import SDBConnectionTest
42
print "test.py [-t testsuite] [-v verbosity]"
43
print " -t run specific testsuite (s3|ssl|s3ver|s3nover|gs|sqs|ec2|sdb|all)"
44
print " -v verbosity (0|1|2)"
48
opts, args = getopt.getopt(sys.argv[1:], "ht:v:",
49
["help", "testsuite", "verbosity"])
56
if o in ("-h", "--help"):
59
if o in ("-t", "--testsuite"):
61
if o in ("-v", "--verbosity"):
67
tests = suite(testsuite)
72
logging.basicConfig(level=logging.DEBUG)
73
unittest.TextTestRunner(verbosity=verbosity).run(tests)
75
def suite(testsuite="all"):
76
tests = unittest.TestSuite()
77
if testsuite == "all":
78
tests.addTest(unittest.makeSuite(SQSConnectionTest))
79
tests.addTest(unittest.makeSuite(S3ConnectionTest))
80
tests.addTest(unittest.makeSuite(EC2ConnectionTest))
81
tests.addTest(unittest.makeSuite(SDBConnectionTest))
82
tests.addTest(unittest.makeSuite(AutoscaleConnectionTest))
83
elif testsuite == "s3":
84
tests.addTest(unittest.makeSuite(S3ConnectionTest))
85
tests.addTest(unittest.makeSuite(S3VersionTest))
86
elif testsuite == "ssl":
87
tests.addTest(unittest.makeSuite(CertValidationTest))
88
elif testsuite == "s3ver":
89
tests.addTest(unittest.makeSuite(S3VersionTest))
90
elif testsuite == "s3nover":
91
tests.addTest(unittest.makeSuite(S3ConnectionTest))
92
elif testsuite == "gs":
93
tests.addTest(unittest.makeSuite(GSConnectionTest))
94
elif testsuite == "sqs":
95
tests.addTest(unittest.makeSuite(SQSConnectionTest))
96
elif testsuite == "ec2":
97
tests.addTest(unittest.makeSuite(EC2ConnectionTest))
98
elif testsuite == "autoscale":
99
tests.addTest(unittest.makeSuite(AutoscaleConnectionTest))
100
elif testsuite == "sdb":
101
tests.addTest(unittest.makeSuite(SDBConnectionTest))
103
raise ValueError("Invalid choice.")
106
if __name__ == "__main__":