def test_progress_bad_values(self):
Test protobuf.Progress with bad values.
dg = DeltaGenerator(ReportQueue())
values = [-1, 101, -0.01, 1.01]
for value in values:
dg.progress(value)
element = get_element(dg)
self.assertEqual(element.exception.type, "ValueError")
dg.progress("some string")
element = get_element(dg)
self.assertEqual(element.exception.type, "TypeError")
class DeltaGeneratorChartTest(unittest.TestCase):
After Change
Test protobuf.Progress with bad values.
values = [-1, 101, -0.01, 1.01]
for value in values:
self._dg.progress(value)
element = self.queue[-1].delta.new_element
self.assertEqual(element.exception.type, "ValueError")
self._dg.progress("some string")