test FSM class as shown in iPython notebook