def testParseFormatBinaryInteger(self,
                                  string,
                                  expected_value,
                                  expected_format,
                                  kwargs=None):
     if kwargs is None:
         kwargs = {}
     actual_value = self.RunTestCase(scaled_integer.ParseBinaryInteger,
                                     string, expected_value, kwargs)
     if actual_value is None:
         return
     kwargs.pop('default_unit', None)
     actual_format = scaled_integer.FormatInteger(actual_value, **kwargs)
     self.assertEqual(expected_format, actual_format)
示例#2
0
 def Display(self, value):
     """Returns the display string for a binary scaled value."""
     if self._output_unit_value:
         value *= self._output_unit_value
     return scaled_integer.FormatInteger(value, type_abbr=self._type_abbr)