ApplyAngularImpulse with zero inertia

I have some questions about inertia and applying rotational impulses. Here's a unit test* that is failing, and I don't understand why:

Code:
def test_apply_angular_impulse():
   from Box2D import b2World
   world = b2World(gravity=(0,0))
   body = world.CreateDynamicBody()
   assert body.mass == 1                            # passes because the default body mass is 1
   assert body.angularVelocity == 0                 # passes because by default the body is not rotating
   assert body.inertia == 0                         # passes (why?)
   body.ApplyAngularImpulse(1.0)                    # apply a small impulse that should cause the body to rotate
   world.Step(1/60.0, 10, 10)                       # update the world
   assert body.angularVelocity != 0                 # fails (why?)


I'm assuming that ApplyAngularImpulse is used just like ApplyLinearImpulse, only for rotation instead of velocity. Looking at the b2Body code, I see that angularVelocity will not be modified when inertia is zero, but in fact, inertia is zero in my test. So, why is inertia zero, and what can I do to correct that?

* The code is written in Python 2.7.2 with PyBox2d 2.1b1, but it should be readable even if you don't know Python.
Typically the rotational inertia of a dynamic body is determined by the fixtures it has. Your test is working with a fixture-less body, so unless you otherwise set the inertia (eg. SetMassData) it will remain at the default of zero.

A similar 'wtf?' causing issue is that the default density of a fixture is zero, and if you create a fixture with density of zero the body's rotational inertia can remain as zero even when it does have a fixture, and Box2D does not complain.

If you want a valid rotational inertia, you'll have to create a non-zero density fixture on the body.
Thanks, that worked.

I added a fixture with a radius and density of 1, and angularVelocity was roughly 0.63662 after one update step:

Code:
   body.CreateCircleFixture(radius=1.0, density=1)


I was also able to directly set the body's inertia:

Code:
   body.massData = b2MassData(I=1)


This made for an even better test, because the exact inertia value of 1 resulted in an angularVelocity of 1.0 after the update.

Original thread: https://box2d.org/forum/viewtopic.php?t=8010