Pass format spec as a parameter.
Unit tests for the common.battery segment.