def test_with_wrong_overflow_type(num, overflow, error_type): """Test overflow_format with wrong """ with pytest.raises(ValueError) as exc_info: utils.overflow_format(num, overflow) exception_msg = exc_info.value.args[0] assert exception_msg == "Input argument 'overflow' should be int type, " \ "but get <type '{}'>".format(error_type)
def test_overflow_format(num, overflow, result): """Test overflow_format with normal arg.""" assert utils.overflow_format(num, overflow) == result
def _update_number(self): self._badge_button.setText(utils.overflow_format(self._count, self._overflow_count)) self._badge_button.setVisible(self._count > 0) self._dot = None self.style().polish(self)