~txaws-dev/txaws/trunk

« back to all changes in this revision

Viewing changes to txaws/server/tests/test_schema.py

  • Committer: Duncan McGreggor
  • Date: 2012-01-27 07:04:32 UTC
  • mfrom: (111.5.9 920302-python2.5-compat)
  • Revision ID: duncan@dreamhost.com-20120127070432-9ywtuw041cm5yh6y
Final missing chunk of Python 2.5 compatibility fixes. The others were
committed prematurely to trunk in r124 and r125.

Reviewed by: Stephon Striplin
Fixes: https://bugs.launchpad.net/txaws/+bug/920302

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
    Arguments, Bool, Date, Enum, Integer, Parameter, RawStr, Schema, Unicode)
12
12
 
13
13
 
14
 
class ArgumentsTest(TestCase):
 
14
class ArgumentsTestCase(TestCase):
15
15
 
16
16
    def test_instantiate_empty(self):
17
17
        """Creating an L{Arguments} object."""
56
56
        self.assertEqual("egg", arguments.foo[0])
57
57
 
58
58
 
59
 
class ParameterTest(TestCase):
 
59
class ParameterTestCase(TestCase):
60
60
 
61
61
    def test_coerce(self):
62
62
        """
188
188
        self.assertEqual("foo", parameter.coerce("foo"))
189
189
 
190
190
 
191
 
class UnicodeTest(TestCase):
 
191
class UnicodeTestCase(TestCase):
192
192
 
193
193
    def test_parse(self):
194
194
        """L{Unicode.parse} converts the given raw C{value} to C{unicode}."""
232
232
        self.assertEqual("InvalidParameterValue", error.code)
233
233
 
234
234
 
235
 
class RawStrTest(TestCase):
 
235
class RawStrTestCase(TestCase):
236
236
 
237
237
    def test_parse(self):
238
238
        """L{RawStr.parse} checks that the given raw C{value} is a string."""
247
247
        self.assertTrue(isinstance(value, str))
248
248
 
249
249
 
250
 
class IntegerTest(TestCase):
 
250
class IntegerTestCase(TestCase):
251
251
 
252
252
    def test_parse(self):
253
253
        """L{Integer.parse} converts the given raw C{value} to C{int}."""
265
265
        self.assertEqual("123", parameter.format(123))
266
266
 
267
267
 
268
 
class BoolTest(TestCase):
 
268
class BoolTestCase(TestCase):
269
269
 
270
270
    def test_parse(self):
271
271
        """L{Bool.parse} converts 'true' to C{True}."""
292
292
        self.assertEqual("false", parameter.format(False))
293
293
 
294
294
 
295
 
class EnumTest(TestCase):
 
295
class EnumTestCase(TestCase):
296
296
 
297
297
    def test_parse(self):
298
298
        """L{Enum.parse} accepts a map for translating values."""
313
313
        self.assertEqual("foo", parameter.format("bar"))
314
314
 
315
315
 
316
 
class DateTest(TestCase):
 
316
class DateTestCase(TestCase):
317
317
 
318
318
    def test_parse(self):
319
319
        """L{Date.parse checks that the given raw C{value} is a date/time."""
332
332
        self.assertEqual("2010-09-15T21:59:59Z", parameter.format(date))
333
333
 
334
334
 
335
 
class SchemaTest(TestCase):
 
335
class SchemaTestCase(TestCase):
336
336
 
337
337
    def test_extract(self):
338
338
        """