Agent penalties

use assertRaises from unittest instead