views:

23

answers:

1

I'm having an odd error where GAEUnit seems to be hung on assertion statements that have error strings that are too long.

I'm running these tests on the GAE Dev server 1.3.3.

This works just fine:

self.assertEquals(2 + 2, 5, "[2, 3, 4]") # works

However, if I defined a longer string, and try to print that out:

    jsonTest = '''[
    {
        'id': '0',
        'name': 'CS 1110',
        'adjacencies': [
        {
            nodeTo: '1.5',
            data:
            {
                $direction: ['0', '1.5']
            }
        },
        {
            nodeTo: '1',
            data:
            {
                $direction: ['0', '1']
            }
        }
        ]
    },

    {
        'id': '1.5',
        'name': 'INFO 2300',
        'adjacencies': [
        {
            nodeTo: '2',
            data:
            {
                $direction: ['1.5', '2']
            }
        }
        ]
    }] '''

       self.assertEquals(2 + 2, 5, jsonTest)

It freezes up. (The "Runs: 2/3" counter stops.)

If I select a shorter segment of jsonTest, it does work:

   self.assertEquals(2 + 2, 5, jsonTest[0:3]) # works
   self.assertEquals(2 + 2, 5, jsonTest[0:10]) # works
   self.assertEquals(2 + 2, 5, jsonTest[0:20]) # works

   self.assertEquals(2 + 2, 5, jsonTest[0:-1]) # frozen

What's going on here? Am I doing something wrong? Is this a bug in GAEUnit?

A: 

Workaround: the ?format=plain option returns plaintext results that seem to work just fine.

Rosarch