Duncan McGreggor has proposed merging lp:~dreamhosters/txaws/920302-python2.5-compat into lp:txaws.
Requested reviews: txAWS Technical List (txaws-tech) Related bugs: Bug #920302 in txAWS: "Some unit tests failing for Python2.5" https://bugs.launchpad.net/txaws/+bug/920302 For more details, see: https://code.launchpad.net/~dreamhosters/txaws/920302-python2.5-compat/+merge/90360 This branch takes care of the Python2.5 errors that were preventing the test suite from completing (some of the fixes involved test skips). -- https://code.launchpad.net/~dreamhosters/txaws/920302-python2.5-compat/+merge/90360 Your team txAWS Technical List is requested to review the proposed merge of lp:~dreamhosters/txaws/920302-python2.5-compat into lp:txaws.
=== modified file 'Makefile' --- Makefile 2012-01-27 00:10:28 +0000 +++ Makefile 2012-01-27 02:22:23 +0000 @@ -23,6 +23,11 @@ @python setup.py sdist +check-testcase-names: + @echo "Checking for (possibly) badly named test cases..." + @find ./txaws|xargs grep Test|grep class|grep -v 'TestCase(' + + virtual-dir-setup: VERSION ?= 2.7 virtual-dir-setup: -@test -d .venv-$(VERSION) || virtualenv -p $(PYBIN)$(VERSION) .venv-$(VERSION) @@ -82,6 +87,7 @@ -@test -e "`which python2.5`" && VERSION=2.5 make virtual-check -@test -e "`which python2.6`" && VERSION=2.6 make virtual-check -@test -e "`which python2.7`" && VERSION=2.7 make virtual-check + make check-testcase-names virtual-uninstall: VERSION ?= 2.7 === modified file 'txaws/client/discover/tests/test_command.py' --- txaws/client/discover/tests/test_command.py 2012-01-12 14:41:59 +0000 +++ txaws/client/discover/tests/test_command.py 2012-01-27 02:22:23 +0000 @@ -20,7 +20,7 @@ self.url = url -class CommandTest(TXAWSTestCase): +class CommandTestCase(TXAWSTestCase): def prepare_command(self, response, status, action, parameters={}, get_page=None, error=None): === modified file 'txaws/client/discover/tests/test_entry_point.py' --- txaws/client/discover/tests/test_entry_point.py 2010-06-04 22:35:23 +0000 +++ txaws/client/discover/tests/test_entry_point.py 2012-01-27 02:22:23 +0000 @@ -12,7 +12,7 @@ from txaws.testing.base import TXAWSTestCase -class ParseOptionsTest(TXAWSTestCase): +class ParseOptionsTestCase(TXAWSTestCase): def test_parse_options(self): """ @@ -165,7 +165,7 @@ "--action", "action", "--help"]) -class GetCommandTest(TXAWSTestCase): +class GetCommandTestCase(TXAWSTestCase): def test_get_command_without_arguments(self): """An L{OptionError} is raised if no arguments are provided.""" @@ -223,7 +223,7 @@ self.assertEqual({"Region.Name.0": "us-west-1"}, command.parameters) -class MainTest(TXAWSTestCase): +class MainTestCase(TXAWSTestCase): def test_usage_message(self): """ === modified file 'txaws/client/gui/tests/test_gtk.py' --- txaws/client/gui/tests/test_gtk.py 2012-01-23 01:02:16 +0000 +++ txaws/client/gui/tests/test_gtk.py 2012-01-27 02:22:23 +0000 @@ -4,7 +4,7 @@ from twisted.trial.unittest import TestCase -class UITests(TestCase): +class UITestCase(TestCase): pass # Really need some, but UI testing hurts my brain. === modified file 'txaws/s3/tests/test_acls.py' --- txaws/s3/tests/test_acls.py 2012-01-26 23:05:01 +0000 +++ txaws/s3/tests/test_acls.py 2012-01-27 02:22:23 +0000 @@ -4,7 +4,7 @@ from txaws.s3 import acls -class ACLTests(TestCase): +class ACLTestCase(TestCase): def test_owner_to_xml(self): owner = acls.Owner(id='8a6925ce4adf588a4f21c32aa379004fef', === modified file 'txaws/s3/tests/test_client.py' --- txaws/s3/tests/test_client.py 2012-01-27 01:19:27 +0000 +++ txaws/s3/tests/test_client.py 2012-01-27 02:22:23 +0000 @@ -309,79 +309,6 @@ d = s3.get_bucket_lifecycle("mybucket") return d.addCallback(check_results) - def test_get_bucket_website_config(self): - """ - L{S3Client.get_bucket_website_config} creates a L{Query} to get a - bucket's website configurtion. It parses the returned - C{WebsiteConfiguration} XML document and returns a C{Deferred} that - fires with the bucket's region. - """ - - class StubQuery(client.Query): - - def __init__(query, action, creds, endpoint, bucket=None, - object_name=None): - super(StubQuery, query).__init__(action=action, creds=creds, - bucket=bucket, - object_name=object_name) - self.assertEquals(action, "GET") - self.assertEqual(creds.access_key, "foo") - self.assertEqual(creds.secret_key, "bar") - self.assertEqual(query.bucket, "mybucket") - self.assertEqual(query.object_name, "?website") - self.assertEqual(query.data, "") - self.assertEqual(query.metadata, {}) - self.assertEqual(query.amz_headers, {}) - - def submit(query, url_context=None): - return succeed(payload. - sample_s3_get_bucket_website_no_error_result) - - def check_results(website_config): - self.assertEquals(website_config.index_suffix, "index.html") - self.assertEquals(website_config.error_key, None) - - creds = AWSCredentials("foo", "bar") - s3 = client.S3Client(creds, query_factory=StubQuery) - d = s3.get_bucket_website_config("mybucket") - return d.addCallback(check_results) - - def test_get_bucket_website_config_with_error_doc(self): - """ - L{S3Client.get_bucket_website_config} creates a L{Query} to get a - bucket's website configurtion. It parses the returned - C{WebsiteConfiguration} XML document and returns a C{Deferred} that - fires with the bucket's region. - """ - - class StubQuery(client.Query): - - def __init__(query, action, creds, endpoint, bucket=None, - object_name=None): - super(StubQuery, query).__init__(action=action, creds=creds, - bucket=bucket, - object_name=object_name) - self.assertEquals(action, "GET") - self.assertEqual(creds.access_key, "foo") - self.assertEqual(creds.secret_key, "bar") - self.assertEqual(query.bucket, "mybucket") - self.assertEqual(query.object_name, "?website") - self.assertEqual(query.data, "") - self.assertEqual(query.metadata, {}) - self.assertEqual(query.amz_headers, {}) - - def submit(query, url_context=None): - return succeed(payload.sample_s3_get_bucket_website_result) - - def check_results(website_config): - self.assertEquals(website_config.index_suffix, "index.html") - self.assertEquals(website_config.error_key, "404.html") - - creds = AWSCredentials("foo", "bar") - s3 = client.S3Client(creds, query_factory=StubQuery) - d = s3.get_bucket_website_config("mybucket") - return d.addCallback(check_results) - def test_delete_bucket(self): class StubQuery(client.Query): @@ -919,7 +846,7 @@ QueryTestCase.skip = s3clientSkip -class MiscellaneousTests(TXAWSTestCase): +class MiscellaneousTestCase(TXAWSTestCase): def test_content_md5(self): self.assertEqual(calculate_md5("somedata"), "rvr3UC1SmUw7AZV2NqPN0g==") === modified file 'txaws/server/tests/test_call.py' --- txaws/server/tests/test_call.py 2012-01-12 14:41:59 +0000 +++ txaws/server/tests/test_call.py 2012-01-27 02:22:23 +0000 @@ -3,7 +3,7 @@ from txaws.server.call import Call -class CallTest(TestCase): +class CallTestCase(TestCase): def test_default_version(self): """ === modified file 'txaws/server/tests/test_exception.py' --- txaws/server/tests/test_exception.py 2012-01-23 01:12:50 +0000 +++ txaws/server/tests/test_exception.py 2012-01-27 02:22:23 +0000 @@ -5,7 +5,7 @@ from txaws.server.exception import APIError -class APIErrorTest(TestCase): +class APIErrorTestCase(TestCase): def test_with_no_parameters(self): """ === modified file 'txaws/server/tests/test_method.py' --- txaws/server/tests/test_method.py 2011-08-19 11:45:12 +0000 +++ txaws/server/tests/test_method.py 2012-01-27 02:22:23 +0000 @@ -3,10 +3,10 @@ from txaws.server.method import Method -class MethodTest(TestCase): +class MethodTestCase(TestCase): def setUp(self): - super(MethodTest, self).setUp() + super(MethodTestCase, self).setUp() self.method = Method() def test_defaults(self): === modified file 'txaws/server/tests/test_registry.py' --- txaws/server/tests/test_registry.py 2012-01-27 00:38:05 +0000 +++ txaws/server/tests/test_registry.py 2012-01-27 02:22:23 +0000 @@ -16,14 +16,14 @@ has_venusian = False -class RegistryTest(TestCase): +class RegistryTestCase(TestCase): if no_class_decorators: skip = ("Your version of Python doesn't seem to support class " "decorators.") def setUp(self): - super(RegistryTest, self).setUp() + super(RegistryTestCase, self).setUp() self.registry = Registry() def test_add(self): === modified file 'txaws/server/tests/test_resource.py' --- txaws/server/tests/test_resource.py 2012-01-27 00:10:28 +0000 +++ txaws/server/tests/test_resource.py 2012-01-27 02:22:23 +0000 @@ -102,10 +102,10 @@ return str("%s - %s" % (error.code, safe_str(error.message))) -class QueryAPITest(TestCase): +class QueryAPITestCase(TestCase): def setUp(self): - super(QueryAPITest, self).setUp() + super(QueryAPITestCase, self).setUp() self.registry = Registry() self.registry.add(TestMethod, action="SomeAction", version=None) self.api = TestQueryAPI(registry=self.registry) === modified file 'txaws/server/tests/test_schema.py' --- txaws/server/tests/test_schema.py 2012-01-23 01:12:50 +0000 +++ txaws/server/tests/test_schema.py 2012-01-27 02:22:23 +0000 @@ -11,7 +11,7 @@ Arguments, Bool, Date, Enum, Integer, Parameter, RawStr, Schema, Unicode) -class ArgumentsTest(TestCase): +class ArgumentsTestCase(TestCase): def test_instantiate_empty(self): """Creating an L{Arguments} object.""" @@ -56,7 +56,7 @@ self.assertEqual("egg", arguments.foo[0]) -class ParameterTest(TestCase): +class ParameterTestCase(TestCase): def test_coerce(self): """ @@ -188,7 +188,7 @@ self.assertEqual("foo", parameter.coerce("foo")) -class UnicodeTest(TestCase): +class UnicodeTestCase(TestCase): def test_parse(self): """L{Unicode.parse} converts the given raw C{value} to C{unicode}.""" @@ -232,7 +232,7 @@ self.assertEqual("InvalidParameterValue", error.code) -class RawStrTest(TestCase): +class RawStrTestCase(TestCase): def test_parse(self): """L{RawStr.parse} checks that the given raw C{value} is a string.""" @@ -247,7 +247,7 @@ self.assertTrue(isinstance(value, str)) -class IntegerTest(TestCase): +class IntegerTestCase(TestCase): def test_parse(self): """L{Integer.parse} converts the given raw C{value} to C{int}.""" @@ -265,7 +265,7 @@ self.assertEqual("123", parameter.format(123)) -class BoolTest(TestCase): +class BoolTestCase(TestCase): def test_parse(self): """L{Bool.parse} converts 'true' to C{True}.""" @@ -292,7 +292,7 @@ self.assertEqual("false", parameter.format(False)) -class EnumTest(TestCase): +class EnumTestCase(TestCase): def test_parse(self): """L{Enum.parse} accepts a map for translating values.""" @@ -313,7 +313,7 @@ self.assertEqual("foo", parameter.format("bar")) -class DateTest(TestCase): +class DateTestCase(TestCase): def test_parse(self): """L{Date.parse checks that the given raw C{value} is a date/time.""" @@ -332,7 +332,7 @@ self.assertEqual("2010-09-15T21:59:59Z", parameter.format(date)) -class SchemaTest(TestCase): +class SchemaTestCase(TestCase): def test_extract(self): """ === modified file 'txaws/tests/test_credentials.py' --- txaws/tests/test_credentials.py 2009-08-28 20:13:07 +0000 +++ txaws/tests/test_credentials.py 2012-01-27 02:22:23 +0000 @@ -7,7 +7,7 @@ from txaws.testing.base import TXAWSTestCase -class TestCredentials(TXAWSTestCase): +class CredentialsTestCase(TXAWSTestCase): def test_no_access_errors(self): # Without anything in os.environ, AWSService() blows up === modified file 'txaws/tests/test_util.py' --- txaws/tests/test_util.py 2012-01-23 01:21:37 +0000 +++ txaws/tests/test_util.py 2012-01-27 02:22:23 +0000 @@ -5,7 +5,7 @@ from txaws.util import hmac_sha1, iso8601time, parse -class MiscellaneousTests(TestCase): +class MiscellaneousTestCase(TestCase): def test_hmac_sha1(self): cases = [ === modified file 'txaws/tests/test_wsdl.py' --- txaws/tests/test_wsdl.py 2012-01-27 00:10:28 +0000 +++ txaws/tests/test_wsdl.py 2012-01-27 02:22:23 +0000 @@ -15,7 +15,7 @@ skip = "lxml is either not installed or broken on your system." -class NodeSchemaTest(WsdlBaseTestCase): +class NodeSchemaTestCase(WsdlBaseTestCase): def test_create_with_bad_tag(self): """ @@ -70,7 +70,7 @@ self.assertEqual("<foo/>", etree.tostring(schema.dump(foo))) -class NodeItemTest(WsdlBaseTestCase): +class NodeItemTestCase(WsdlBaseTestCase): def test_get(self): """ @@ -281,7 +281,7 @@ self.assertTrue(hasattr(foo, "bar")) -class SequenceSchemaTest(WsdlBaseTestCase): +class SequenceSchemaTestCase(WsdlBaseTestCase): def test_create_with_bad_tag(self): """ @@ -351,7 +351,7 @@ etree.tostring(schema.dump(foo))) -class SequenceItemTest(WsdlBaseTestCase): +class SequenceItemTestCase(WsdlBaseTestCase): def test_get(self): """ @@ -507,10 +507,10 @@ self.assertEqual("egg1", item1.bar) -class WDSLParserTest(WsdlBaseTestCase): +class WDSLParserTestCase(WsdlBaseTestCase): def setUp(self): - super(WDSLParserTest, self).setUp() + super(WDSLParserTestCase, self).setUp() parser = WSDLParser() wsdl_dir = os.path.join(os.path.dirname(__file__), "../../wsdl") wsdl_path = os.path.join(wsdl_dir, "2009-11-30.ec2.wsdl")
_______________________________________________ Mailing list: https://launchpad.net/~txaws-dev Post to : txaws-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~txaws-dev More help : https://help.launchpad.net/ListHelp